-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v23.2.x] [CORE-96]: admin/server fix set_log_level handling of overlapping expirations #18445
[v23.2.x] [CORE-96]: admin/server fix set_log_level handling of overlapping expirations #18445
Conversation
/ci-repeat |
_log_level_resets is a map<str, level_reset>, we want to extract the next expiring level_reset to rearm the _log_level_timer. previously we would extract the min_element based on the key (the logger name) so this sequence of actions set log-level kafka trace 10 set log-level raft trace 10 only kafka would be expired, because once expired the next run would pick again kafka, see that there is no expiration, and not rearm the timer.
84b87b5
to
6444718
Compare
/ci-repeat |
6444718
to
8835ecd
Compare
the test shows that this sequence of actions set log-level admin-api-server trace 10 set log-level raft trace 10 works and both logger are reset after the expiry period
8835ecd
to
e7c299a
Compare
auto next = std::min_element( | ||
_log_level_resets.begin(), | ||
_log_level_resets.end(), | ||
[](const auto& a, const auto& b) { | ||
return a.second.expires < b.second.expires; | ||
}); | ||
|
||
if (next != _log_level_resets.end()) { | ||
_log_level_timer.arm(next->second.expires); | ||
if (_log_level_resets.empty()) { | ||
return; | ||
} | ||
|
||
auto reset_values = _log_level_resets | std::views::values; | ||
auto& lvl_rst = *std::ranges::min_element( | ||
reset_values, std::less<>{}, &level_reset::expires); | ||
_log_level_timer.arm(lvl_rst.expires); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the original actually bugged? Seems like the motivating issue would have been isolated to v23.3+
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah you are right, i didn't notice that v23.2 has the correct comparator
closing this as the bug is not in v23.2 |
Backport of PR #18397
first commit adapted for v23.2
Fixes #18436