Skip to content

Commit e96b3ae

Browse files
committed
application: stop schema_registry clients before datalake subsystems
We've seen a shutdown hang that appears to be caused by a datalake translator getting stuck repeatedly trying to query the schema registry. This attempts to fix this by moving schema registry client shutdown to before datalake shutdown.
1 parent 0c25953 commit e96b3ae

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/v/pandaproxy/schema_registry/api.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ ss::future<> api::start() {
112112
co_await _service.invoke_on_all(&service::start);
113113
}
114114

115+
ss::future<> api::stop_clients() {
116+
co_await _client.invoke_on_all(&kafka::client::client::stop);
117+
}
118+
115119
ss::future<> api::stop() {
116120
vlog(srlog.debug, "Stopping schema registry API...");
117121
co_await _client.invoke_on_all(&kafka::client::client::stop);

src/v/pandaproxy/schema_registry/api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class api {
4949

5050
ss::future<> start();
5151
ss::future<> stop();
52+
ss::future<> stop_clients();
5253
ss::future<> restart();
5354

5455
const configuration& get_config() const;

src/v/redpanda/application.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,11 @@ void application::shutdown() {
374374
return cloud_io.invoke_on_all(&cloud_io::remote::request_stop);
375375
});
376376
}
377+
// Shutdown schema registry clients before the datalake subsystems to
378+
// ensure the datalake subsystems can shutdown quickly.
379+
if (_schema_registry) {
380+
_schema_registry->stop_clients().get();
381+
}
377382
/**
378383
* Shutdown the datalake services before stopping all the partitions.
379384
* NOTE: translators may call into the coordinator via the coordinator

0 commit comments

Comments
 (0)