feat: add timeout to inflight queue waiting#1957
Merged
GaoleMeng merged 73 commits intogoogleapis:mainfrom Jan 25, 2023
GaoleMeng:main
Merged
feat: add timeout to inflight queue waiting#1957GaoleMeng merged 73 commits intogoogleapis:mainfrom GaoleMeng:main
GaoleMeng merged 73 commits intogoogleapis:mainfrom
GaoleMeng:main
Conversation
prerequisite for multiplexing client
new stream name as a switch of destinationt
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
yirutang
reviewed
Jan 25, 2023
| } | ||
|
|
||
| try { | ||
| log.info("Begin shutting down user callback thread pool for stream " + streamName); |
Contributor
There was a problem hiding this comment.
Is this logging accurate? with multiplexing, the identifier shouldn't be streamName. It is not just for this change but in general, seems streamName is not good enough to indicate a connection.
Also seems we should change this log to fine level.
Contributor
Author
There was a problem hiding this comment.
Yes, we need a new kind of identifier besides stream name
let's change them together in the next PR
changed to fine
| + " is interrupted with exception: " | ||
| + e.toString()); | ||
| } | ||
| log.info("User close finishes for stream " + streamName); |
Contributor
There was a problem hiding this comment.
We can remove the line on 395?
| try { | ||
| log.info("Begin shutting down user callback thread pool for stream " + streamName); | ||
| threadPool.shutdown(); | ||
| threadPool.awaitTermination(3, TimeUnit.MINUTES); |
Contributor
There was a problem hiding this comment.
Log when we actually timed out here?
| private static final Logger log = Logger.getLogger(StreamWriter.class.getName()); | ||
|
|
||
| // Maximum wait time on inflight quota before error out. | ||
| private static long INFLIGHT_QUOTA_MAX_WAIT_TIME_MILLI = 180000; |
Contributor
There was a problem hiding this comment.
Make the default to 5 minutes?
yirutang
approved these changes
Jan 25, 2023
gcf-merge-on-green bot
pushed a commit
that referenced
this pull request
Feb 1, 2023
🤖 I have created a release *beep* *boop* --- ## [2.29.0](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.28.4...v2.29.0) (2023-02-01) ### Features * Add timeout to inflight queue waiting ([#1957](https://togithub.com/googleapis/java-bigquerystorage/issues/1957)) ([3159b12](https://togithub.com/googleapis/java-bigquerystorage/commit/3159b120e5cd388cf9776a1fa928a3e6ae105d9d)) * Allow java client to handle schema change during same stream name ([#1964](https://togithub.com/googleapis/java-bigquerystorage/issues/1964)) ([305f71e](https://togithub.com/googleapis/java-bigquerystorage/commit/305f71ee4b274df58388fc3000e9f5da9fc908e1)) ### Bug Fixes * At connection level, retry for internal errors ([#1965](https://togithub.com/googleapis/java-bigquerystorage/issues/1965)) ([9c01bc1](https://togithub.com/googleapis/java-bigquerystorage/commit/9c01bc11b51dc1e3e209e4d6b666b9ddd3212cf5)) * Reduce visibility of the ConnectionPool and ConnectionWorker, so… ([#1954](https://togithub.com/googleapis/java-bigquerystorage/issues/1954)) ([dcb234b](https://togithub.com/googleapis/java-bigquerystorage/commit/dcb234b95d0812d4d91b0c206d0b7e0fb30ab0fa)) * Remove unrecoverable connection from connection pool during multiplexing ([#1967](https://togithub.com/googleapis/java-bigquerystorage/issues/1967)) ([091dddb](https://togithub.com/googleapis/java-bigquerystorage/commit/091dddb9b2baf1f4b481e8d7961d451b71a8508b)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If we don't see the exception thrown by timeout on waiting, we then know it's not deadlock on waiting for in flight queue to have space
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:
Fixes #<issue_number_goes_here> ☕️
If you write sample code, please follow the samples format.