Skip to content
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

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions src/v/redpanda/admin_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
#include <limits>
#include <memory>
#include <numeric>
#include <ranges>
#include <stdexcept>
#include <system_error>
#include <type_traits>
Expand Down Expand Up @@ -622,16 +623,14 @@ void admin_server::log_exception(
void admin_server::rearm_log_level_timer() {
_log_level_timer.cancel();

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);
Comment on lines -625 to +633
Copy link
Member

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+

Copy link
Contributor Author

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

}

void admin_server::log_level_timer_handler() {
Expand Down