diff --git a/src/v/pandaproxy/schema_registry/api.cc b/src/v/pandaproxy/schema_registry/api.cc index b2d527bc9593f..c701f3a7aedda 100644 --- a/src/v/pandaproxy/schema_registry/api.cc +++ b/src/v/pandaproxy/schema_registry/api.cc @@ -112,6 +112,10 @@ ss::future<> api::start() { co_await _service.invoke_on_all(&service::start); } +ss::future<> api::stop_clients() { + co_await _client.invoke_on_all(&kafka::client::client::stop); +} + ss::future<> api::stop() { vlog(srlog.debug, "Stopping schema registry API..."); co_await _client.invoke_on_all(&kafka::client::client::stop); diff --git a/src/v/pandaproxy/schema_registry/api.h b/src/v/pandaproxy/schema_registry/api.h index c415be4b99ab3..be4e44a17e894 100644 --- a/src/v/pandaproxy/schema_registry/api.h +++ b/src/v/pandaproxy/schema_registry/api.h @@ -49,6 +49,7 @@ class api { ss::future<> start(); ss::future<> stop(); + ss::future<> stop_clients(); ss::future<> restart(); const configuration& get_config() const; diff --git a/src/v/redpanda/application.cc b/src/v/redpanda/application.cc index 2869afb8cfe3d..25de8e2ee33cf 100644 --- a/src/v/redpanda/application.cc +++ b/src/v/redpanda/application.cc @@ -374,6 +374,11 @@ void application::shutdown() { return cloud_io.invoke_on_all(&cloud_io::remote::request_stop); }); } + // Shutdown schema registry clients before the datalake subsystems to + // ensure the datalake subsystems can shutdown quickly. + if (_schema_registry) { + _schema_registry->stop_clients().get(); + } /** * Shutdown the datalake services before stopping all the partitions. * NOTE: translators may call into the coordinator via the coordinator