-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set gRPC message options and keepalive. #4269
Set gRPC message options and keepalive. #4269
Conversation
This causes the `.open` method on subscriptions to return a future, which can be used to block the main thread or trap exceptions.
Ignore the long list of commits that included #4265; squash will fix it. :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I'd love it if you addressed my nits 😀
target = '{host}:{port}'.format( | ||
host=subscriber_client.SubscriberClient.SERVICE_ADDRESS, | ||
port=subscriber_client.SubscriberClient.DEFAULT_SERVICE_PORT, | ||
) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
'grpc.max_send_message_length': -1, | ||
'grpc.max_receive_message_length': -1, | ||
'grpc.keepalive_time_ms': 30000, | ||
}.items(), |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
host=subscriber_client.SubscriberClient.SERVICE_ADDRESS, | ||
port=subscriber_client.SubscriberClient.DEFAULT_SERVICE_PORT, | ||
) | ||
kwargs.setdefault('channel', grpc_helpers.create_channel( |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
import grpc | ||
|
||
from google import auth | ||
from google.api_core import grpc_helpers |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
host=subscriber_client.SubscriberClient.SERVICE_ADDRESS, | ||
port=subscriber_client.SubscriberClient.DEFAULT_SERVICE_PORT, | ||
) | ||
kwargs.setdefault('channel', grpc_helpers.create_channel( |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -66,6 +91,18 @@ def __init__(self, batch_settings=(), batch_class=thread.Batch, **kwargs): | |||
self._batch_lock = threading.Lock() | |||
self._batches = {} | |||
|
|||
@property | |||
def target(self): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Fixes #4083, although the UNAVAILABLE errors still occur sometimes for other reasons.
That will need to be handled with new retry logic, and is being tracked as #4234.
Addendum: Fixes #3886.