Skip to content

fix(pubsub): avoid deadlock by ensuring lease refresh timer runs on cq thread - #16297

Open
scotthart wants to merge 1 commit into
googleapis:mainfrom
scotthart:pubsub_lease_refresh_timer
Open

fix(pubsub): avoid deadlock by ensuring lease refresh timer runs on cq thread#16297
scotthart wants to merge 1 commit into
googleapis:mainfrom
scotthart:pubsub_lease_refresh_timer

Conversation

@scotthart

Copy link
Copy Markdown
Member

No description provided.

@scotthart
scotthart requested a review from a team as a code owner July 30, 2026 19:00
@product-auto-label product-auto-label Bot added the api: pubsub Issues related to the Pub/Sub API. label Jul 30, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses a self-deadlock issue in SubscriptionLeaseManagement::StartRefreshTimer by dispatching the lease refresh-timer continuation asynchronously via cq_.RunAsync instead of running it inline. This ensures that OnRefreshTimer always runs on a CompletionQueue thread without holding the mu_ lock. The associated unit tests have been updated to handle the deferred execution, and a new regression test has been added to verify this behavior. I have no feedback to provide.

@scotthart

Copy link
Copy Markdown
Member Author

Resubmission of #16250

@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.31%. Comparing base (d799c3f) to head (3123f01).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #16297   +/-   ##
=======================================
  Coverage   92.31%   92.31%           
=======================================
  Files        2223     2223           
  Lines      208086   208128   +42     
=======================================
+ Hits       192086   192131   +45     
+ Misses      16000    15997    -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsub Issues related to the Pub/Sub API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant