-
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
Reject PP/SR HTTP requests if cross shard semaphore has been exhausted #15977
Changes from all commits
9b11ec3
9bedb5e
f7707d2
e088ac3
260d1d5
b9c0384
dc0d6cf
5a4d0ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
#include "cluster/ephemeral_credential_frontend.h" | ||
#include "cluster/members_table.h" | ||
#include "cluster/security_frontend.h" | ||
#include "config/configuration.h" | ||
#include "kafka/client/brokers.h" | ||
#include "kafka/client/client_fetch_batch_reader.h" | ||
#include "kafka/client/config_utils.h" | ||
|
@@ -502,8 +503,13 @@ service::service( | |
ss::sharded<security::audit::audit_log_manager>& audit_mgr) | ||
: _config(config) | ||
, _mem_sem(max_memory, "pproxy/schema-svc") | ||
, _inflight_sem(config::shard_local_cfg() | ||
.max_in_flight_schema_registry_requests_per_shard()) | ||
, _inflight_config_binding( | ||
config::shard_local_cfg() | ||
.max_in_flight_schema_registry_requests_per_shard.bind()) | ||
, _client(client) | ||
, _ctx{{{}, _mem_sem, {}, smp_sg}, *this} | ||
, _ctx{{{}, _mem_sem, _inflight_sem, {}, smp_sg}, *this} | ||
, _server( | ||
"schema_registry", // server_name | ||
"schema_registry", // public_metric_group_name | ||
|
@@ -520,7 +526,10 @@ service::service( | |
, _auth{ | ||
config::always_true(), | ||
config::shard_local_cfg().superusers.bind(), | ||
controller.get()} {} | ||
controller.get()} { | ||
_inflight_config_binding.watch( | ||
[this]() { _inflight_sem.set_capacity(_inflight_config_binding()); }); | ||
Comment on lines
+530
to
+531
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't destruction sequence order dictated by the class? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW I find relying on destructor order is incredibly sneaky and usually deserves a comment somewhere There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You're correct. |
||
} | ||
|
||
ss::future<> service::start() { | ||
co_await configure(); | ||
|
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.
_inflight_sem
could be destructed at this point (I don't see another mechanism that unsubscribes the watch, or otherwise sequences the destruction order.