Skip to content

Conversation

@anitarua
Copy link
Contributor

@anitarua anitarua commented Jun 27, 2025

Closes https://github.com/momentohq/dev-eco-issue-tracker/issues/1149

The timeout argument 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.

@anitarua anitarua requested a review from a team June 27, 2025 21:41

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())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like the other grpc managers simply pass the float into the grpc request, so opted to remove the int conversion to be consistent

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anitarua anitarua requested a review from malandis June 27, 2025 22:34
@anitarua anitarua merged commit 0169714 into main Jun 27, 2025
11 checks passed
@anitarua anitarua deleted the subscribe-timeout branch June 27, 2025 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants