Skip to content

Commit

Permalink
io_queue: Reduce oversized requests warning activity
Browse files Browse the repository at this point in the history
The submission of oversized request is not a "rare" event, if
it happened once, it will happen again and again, because buffer
sizes in scylla are "static". Not to spam logs with tons of such
warnings, print those only if the oversized request is larger
 than the previous one.

Signed-off-by: Pavel Emelyanov <[email protected]>
  • Loading branch information
xemul committed Apr 20, 2021
1 parent c2b1ef6 commit 95b1529
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/io_queue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,16 @@ fair_queue_ticket io_queue::request_fq_ticket(const internal::io_request& req, s
throw std::runtime_error(fmt::format("Unrecognized request passing through I/O queue {}", req.opname()));
}

static thread_local logger::rate_limit rate_limit(std::chrono::seconds(30));
static thread_local size_t oversize_warning_threshold = 0;

if (size >= _group->_maximum_request_size) {
io_log.log(log_level::warn, rate_limit, "oversized request (length {}) submitted. "
if (size > oversize_warning_threshold) {
oversize_warning_threshold = size;
io_log.warn("oversized request (length {}) submitted. "
"dazed and confuzed, trimming its weight from {} down to {}", len,
size >> request_ticket_size_shift,
_group->_maximum_request_size >> request_ticket_size_shift);
}
size = _group->_maximum_request_size;
}

Expand Down

0 comments on commit 95b1529

Please sign in to comment.