File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
src/v/cloud_storage_clients Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -289,12 +289,17 @@ ss::future<client_pool::client_lease> client_pool::acquire(
289289 };
290290 // Use 2-random approach. Pick 2 random shards
291291 auto [sid1, sid2] = pick_two_random_shards ();
292- auto cnt1 = co_await container ().invoke_on (
293- sid1, clients_in_use);
294- // sid1 == sid2 if we have only two shards
295- auto cnt2 = sid1 == sid2 ? cnt1
296- : co_await container ().invoke_on (
297- sid2, clients_in_use);
292+ size_t cnt1 = _capacity;
293+ size_t cnt2 = _capacity;
294+ try {
295+ cnt1 = co_await container ().invoke_on (sid1, clients_in_use);
296+ cnt2 = sid1 == sid2 ? cnt1
297+ : co_await container ().invoke_on (
298+ sid2, clients_in_use);
299+ } catch (const ss::broken_named_semaphore&) {
300+ // Remote shard is shutting down, treat as fully
301+ // utilized so we skip borrowing.
302+ }
298303 auto [sid, cnt] = cnt1 < cnt2 ? std::tie (sid1, cnt1)
299304 : std::tie (sid2, cnt2);
300305 vlog (
You can’t perform that action at this time.
0 commit comments