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

Make block overloaded if dispatch queue processing limit is reached #1070

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions validator/impl/collator-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ class Collator final : public td::actor::Actor {
unsigned dispatch_queue_ops_{0};
std::map<StdSmcAddress, LogicalTime> last_dispatch_queue_emitted_lt_;
bool have_unprocessed_account_dispatch_queue_ = false;
bool dispatch_queue_total_limit_reached_ = false;
td::uint64 defer_out_queue_size_limit_;
td::uint64 hard_defer_out_queue_size_limit_;

Expand Down
26 changes: 16 additions & 10 deletions validator/impl/collator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3714,6 +3714,7 @@ bool Collator::process_dispatch_queue() {
}
++total_count;
if (total_count >= max_total_count[iter]) {
dispatch_queue_total_limit_reached_ = true;
break;
}
}
Expand Down Expand Up @@ -4660,7 +4661,21 @@ bool Collator::check_block_overload() {
<< " lt_delta=" << block_limit_status_->cur_lt - block_limit_status_->limits.start_lt
<< " size_estimate=" << block_size_estimate_;
auto cl = block_limit_status_->classify();
if (cl <= block::ParamLimits::cl_underload) {
if (cl >= block::ParamLimits::cl_soft || dispatch_queue_total_limit_reached_) {
std::string message = "block is overloaded ";
if (cl >= block::ParamLimits::cl_soft) {
message += PSTRING() << "(category " << cl << ")";
} else {
message += "(long dispatch queue processing)";
}
if (out_msg_queue_size_ > SPLIT_MAX_QUEUE_SIZE) {
LOG(INFO) << message << ", but don't set overload history because out_msg_queue size is too big to split ("
<< out_msg_queue_size_ << " > " << SPLIT_MAX_QUEUE_SIZE << ")";
} else {
overload_history_ |= 1;
LOG(INFO) << message;
}
} else if (cl <= block::ParamLimits::cl_underload) {
if (out_msg_queue_size_ > MERGE_MAX_QUEUE_SIZE) {
LOG(INFO)
<< "block is underloaded, but don't set underload history because out_msg_queue size is too big to merge ("
Expand All @@ -4669,15 +4684,6 @@ bool Collator::check_block_overload() {
underload_history_ |= 1;
LOG(INFO) << "block is underloaded";
}
} else if (cl >= block::ParamLimits::cl_soft) {
if (out_msg_queue_size_ > SPLIT_MAX_QUEUE_SIZE) {
LOG(INFO) << "block is overloaded (category " << cl
<< "), but don't set overload history because out_msg_queue size is too big to split ("
<< out_msg_queue_size_ << " > " << SPLIT_MAX_QUEUE_SIZE << ")";
} else {
overload_history_ |= 1;
LOG(INFO) << "block is overloaded (category " << cl << ")";
}
} else {
LOG(INFO) << "block is loaded normally";
}
Expand Down
Loading