Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

fix: fix one potential root cause of deadlock in connection worker#1955

Merged
GaoleMeng merged 71 commits into
googleapis:mainfrom
GaoleMeng:main
Jan 25, 2023
Merged

fix: fix one potential root cause of deadlock in connection worker#1955
GaoleMeng merged 71 commits into
googleapis:mainfrom
GaoleMeng:main

Conversation

@GaoleMeng

@GaoleMeng GaoleMeng commented Jan 23, 2023

Copy link
Copy Markdown
Contributor

The deadlock may happen when we try to insert messages inside message callback and the request queue happen to be full.
During the above mentioned pattern, the following happened in sequence:

  1. RequestCallback triggered in connectionWorker.java
  2. appendResult.setException is triggered
  3. user's provided callback triggered, triggering append
  4. inflight queue happen to be full, stuck in waiting in flight queue back in normal
    however inflight queue can't be progressed until step 1 finish, as there could be only one requestCallback triggered each time
    The fix was to fix the example code by puting the append at another thread, it solved issue but not good enough. The true fix is to put step 2 to another thread directly so that step 1 is unblocked. This will fix any user on the original example code directly.

The example code can also be upgraded to remove the unnecessary thread pool

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> ☕️

If you write sample code, please follow the samples format.

GaoleMeng and others added 30 commits September 13, 2022 01:58
also fixed a tiny bug inside fake bigquery write impl for getting thre
response from offset
possible the proto schema does not contain this field
@GaoleMeng GaoleMeng added the kokoro:run Add this label to force Kokoro to re-run the tests. label Jan 24, 2023
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jan 24, 2023
@GaoleMeng GaoleMeng added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Jan 24, 2023
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jan 24, 2023
@GaoleMeng GaoleMeng added the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 24, 2023
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 24, 2023
@gcf-owl-bot gcf-owl-bot Bot requested a review from a team January 24, 2023 19:34
@GaoleMeng GaoleMeng added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 24, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 24, 2023
@GaoleMeng GaoleMeng added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 24, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 24, 2023
@GaoleMeng GaoleMeng added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 24, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 24, 2023
@GaoleMeng GaoleMeng added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Jan 25, 2023
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jan 25, 2023
@GaoleMeng GaoleMeng added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Jan 25, 2023
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jan 25, 2023
@GaoleMeng GaoleMeng added the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 25, 2023
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 25, 2023
@GaoleMeng GaoleMeng merged commit 598ce5e into googleapis:main Jan 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants