Skip to content

fix(bigtable): resolve deadlock in ClientConfigurationManager when notifying callbacks#13192

Merged
gcf-merge-on-green[bot] merged 1 commit into
googleapis:mainfrom
igorbernstein2:client-config-race
May 14, 2026
Merged

fix(bigtable): resolve deadlock in ClientConfigurationManager when notifying callbacks#13192
gcf-merge-on-green[bot] merged 1 commit into
googleapis:mainfrom
igorbernstein2:client-config-race

Conversation

@igorbernstein2
Copy link
Copy Markdown
Contributor

Resolve a circular dependency deadlock between ClientConfigurationManagerand SessionPoolImpl monitor locks.

  • Release the ClientConfigurationManager lock before executing listener callbacks.
  • Remove synchronized from setClientConfiguration and handleFailedFetch signatures,restricting synchronization to direct field updates.
  • Simplify concurrency design by introducing a volatile closed flag onListenerEntry, making notifying state and pendingListenerRemovals redundant.

@igorbernstein2 igorbernstein2 requested review from a team as code owners May 14, 2026 17:50
Copy link
Copy Markdown
Contributor

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

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 refactors the locking strategy in ClientConfigurationManager to prevent deadlocks by moving listener notifications outside of synchronized blocks and simplifying listener management with a volatile closed flag. A new test case, testDeadlockPrevention, validates these changes. However, the reviewer identified potential race conditions in handleFailedFetch and setClientConfiguration where state checks and updates are no longer atomic, which could lead to inconsistent configurations or out-of-order notifications.

@igorbernstein2 igorbernstein2 added the automerge Merge the pull request once unit tests and other checks pass. label May 14, 2026
…tifying callbacks

Resolve a circular dependency deadlock between ClientConfigurationManagerand SessionPoolImpl monitor locks.
- Release the ClientConfigurationManager lock before executing listener callbacks.
- Remove synchronized from setClientConfiguration and handleFailedFetch signatures,restricting synchronization to direct field updates.
- Simplify concurrency design by introducing a volatile closed flag onListenerEntry, making notifying state and pendingListenerRemovals redundant.
@gcf-merge-on-green gcf-merge-on-green Bot merged commit c98e53d into googleapis:main May 14, 2026
179 of 182 checks passed
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label May 14, 2026
@igorbernstein2 igorbernstein2 deleted the client-config-race branch May 14, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants