fix(page_service): Timeline::gate held open while throttling (#10314)

When we moved throttling up from Timeline::get into page_service,
we stopped being sensitive to `Timeline::cancel`, even though we're
holding a Handle and thus a guard on the `Timeline::gate` open.

This PR rectifies the situation.

Refs

- Found while investigating #10309 (hung detach because gate kept open),
  but not expected to be the root cause of that issue because the
  affected tenants are not being throttled according to their metrics.
This commit is contained in:
Christian Schwarz
2025-01-10 20:21:01 +01:00
committed by GitHub
parent cdd34dfc12
commit 9b43204893

View File

@@ -618,6 +618,9 @@ impl BatchedFeMessage {
};
let throttled = tokio::select! {
throttled = shard.pagestream_throttle.throttle(tokens) => { throttled }
_ = shard.cancel.cancelled() => {
return Err(QueryError::Shutdown);
}
_ = cancel.cancelled() => {
return Err(QueryError::Shutdown);
}