Skip to content
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

fix: return topic subscribe error immediately if subscription limit reached #61

Closed
wants to merge 5 commits into from

Conversation

anitarua
Copy link
Collaborator

@anitarua anitarua commented Jan 5, 2024

addresses #55

Checks that the first message is a heartbeat before returning a TopicSubscription or TopicSubscribeError response. Now, if a user tries to subscribe >100 times, they will get a TopicSubscribeError saying they've reached the 100 subscriber limit.

Also did some testing and determined that the keepalive settings seemed to be interfering with the ability to reconnect. Keepalive settings might not play well with the default backoff and retry strategy that dart-grpc uses, so removed for now.

Before (with keepalive settings):

FINE: 2024-01-04 15:20:46.537611: topic client received a heartbeat
FINE: 2024-01-04 15:20:53.061621: Attempting to reconnect after receiving error: gRPC Error (code: 2, codeName: UNKNOWN, message: HTTP/2 error: Connection error: Connection is being forcefully terminated. (errorCode: 10), details: null, rawResponse: null, trailers: {})
FINE: 2024-01-04 15:20:53.065014: Error reconnecting: Error connecting: Connection shutting down

After (without keepalive settings):

FINE: 2024-01-05 10:00:06.773596: topic client received a heartbeat
FINE: 2024-01-05 10:06:10.777344: Attempting to reconnect after receiving error: gRPC Error (code: 2, codeName: UNKNOWN, message: HTTP/2 error: Connection error: Connection is being forcefully terminated. (errorCode: 10), details: null, rawResponse: null, trailers: {})

@anitarua anitarua closed this Jan 5, 2024
@anitarua anitarua deleted the max-subscriptions branch January 5, 2024 18:35
@bruuuuuuuce bruuuuuuuce restored the max-subscriptions branch January 5, 2024 18:45
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.

None yet

1 participant