pubsub: reconnect with old executor#2498
Merged
pongad merged 1 commit intogoogleapis:masterfrom Oct 11, 2017
pongad:pubsub-spam
Merged
pubsub: reconnect with old executor#2498pongad merged 1 commit intogoogleapis:masterfrom pongad:pubsub-spam
pongad merged 1 commit intogoogleapis:masterfrom
pongad:pubsub-spam
Conversation
We register a callback to reconnect connection when old connection closes. When we shut down the subscriber, we close all connections and begin to shutdown executor. There is a race: if the callback is called after executor closes, an exception occurs and we print a scary stack trace. It doesn't do anything bad; the subscriber is going to go away anyway, but the stack trace is still confusing. This commit avoids registering new jobs on executors. When a connection closes, the callback to determine whether we should reconnect is called in the RPC thread. If the connection closes due to some error, the callback should quickly determine whether we should reconnection. If so, we register the actual reconnection job on a separate thread. This does not block RPC thread, and everyone should be happy. If the connection closes because we're shutting down, the callback running on RPC thread should determine that we should NOT reconnect, not register a reconnection job, and we shouldn't see a stack trace. Fixes #2485.
Contributor
|
LGTM |
schmidt-sebastian
pushed a commit
to FirebasePrivate/google-cloud-java
that referenced
this pull request
Nov 9, 2017
We register a callback to reconnect connection when old connection closes. When we shut down the subscriber, we close all connections and begin to shutdown executor. There is a race: if the callback is called after executor closes, an exception occurs and we print a scary stack trace. It doesn't do anything bad; the subscriber is going to go away anyway, but the stack trace is still confusing. This commit avoids registering new jobs on executors. When a connection closes, the callback to determine whether we should reconnect is called in the RPC thread. If the connection closes due to some error, the callback should quickly determine whether we should reconnection. If so, we register the actual reconnection job on a separate thread. This does not block RPC thread, and everyone should be happy. If the connection closes because we're shutting down, the callback running on RPC thread should determine that we should NOT reconnect, not register a reconnection job, and we shouldn't see a stack trace. Fixes googleapis#2485.
chingor13
pushed a commit
that referenced
this pull request
Feb 20, 2026
* feat: add ability to write Range values with JSONStreamWriter * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update tests to include mixed case and string values * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Add Arrow processor to validate reading range values * Add test scope to Arrow dependencies * Fix unit test * Fix maven dependencies check failure for arrow * Add arrow-memory-netty to fix sample exception issue with no DefaultAllocationManager * Temp remove arrow test dependencies to test sample failure * Further testing * Test by hard coding test arrow version * Revert changes for testing * Pass dep. check * Updated test for case sensitivity * Update integration test for case sensitivity for all cases * Update JsonToProtoMessageTest to include mixed case fields --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
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.
We register a callback to reconnect connection when old connection closes.
When we shut down the subscriber, we close all connections and
begin to shutdown executor.
There is a race: if the callback is called after executor closes,
an exception occurs and we print a scary stack trace.
It doesn't do anything bad; the subscriber is going to go away anyway,
but the stack trace is still confusing.
This commit avoids registering new jobs on executors.
When a connection closes, the callback to determine whether we should
reconnect is called in the RPC thread.
If the connection closes due to some error, the callback should quickly
determine whether we should reconnection. If so, we register the actual
reconnection job on a separate thread. This does not block RPC thread,
and everyone should be happy.
If the connection closes because we're shutting down,
the callback running on RPC thread should determine that we should NOT
reconnect, not register a reconnection job, and we shouldn't see
a stack trace.
Fixes #2485.