Conversation
malandis
reviewed
Jun 27, 2025
|
|
||
| default_deadline: timedelta = configuration.get_transport_strategy().get_grpc_configuration().get_deadline() | ||
| self._default_deadline_seconds = default_deadline.total_seconds() | ||
| self._default_deadline_seconds = int(default_deadline.total_seconds()) |
Contributor
There was a problem hiding this comment.
int truncates the decimal portion, so if the deadline is < 1s (eg 900ms) the deadline will be 0, which seems undesirable. I recommend taking the ceiling. Can add a helper function like total_seconds_ceil (or [insert better name]).
Contributor
Author
There was a problem hiding this comment.
looks like the other grpc managers simply pass the float into the grpc request, so opted to remove the int conversion to be consistent
Contributor
There was a problem hiding this comment.
Yep deadline is floating point: https://github.com/grpc/grpc/blob/master/src/python/grpcio/grpc/_channel.py#L109
malandis
approved these changes
Jun 27, 2025
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.
Closes https://github.com/momentohq/dev-eco-issue-tracker/issues/1149
The
timeoutargument to subscribe calls works to set a timeout, which is already passed into the topic client for the publish calls.Also added tests to verify that setting a short timeout will trigger the DEADLINE_EXCEEDED error for subscribe calls.