Skip to content

Commit

Permalink
fix(page_service): Timeline::gate held open while throttling
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
problame committed Jan 8, 2025
1 parent dc28424 commit 9d758cf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pageserver/src/page_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,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);
}
Expand Down

0 comments on commit 9d758cf

Please sign in to comment.