Skip to content
This repository was archived by the owner on Dec 28, 2024. It is now read-only.

Conversation

svix-daniel
Copy link
Contributor

@svix-daniel svix-daniel commented Feb 1, 2023

Two bugs had been noticed, both with the automatic reconnection interval (where it would forcibly close the connection and reconnect every minute) as the primary cause.

Upon reconnection, the text that prints when you first start the tool in listen mode would reprint causing the logs to be filled with the same connection message many times.

Additionally, there is an issue in the concurrency where, on seemingly random occasions, the program would hang after disconnecting but before reconnecting due to a closed channel.

Finally, changes were made to the channels to avoid potential hanging on channel closure.

By removing this interval and by preventing hanging the reconnection-based bugs should at the very least become much more rare.

@svix-daniel
Copy link
Contributor Author

@fcjr -- if you remember why this was included in the first place, I'd greatly appreciate the insight. If it was there for a good reason, I don't want to remove it. But, testing these changes, the connection will easily last 30+ minutes without any issue when it would regularly fail within 10 minutes when frequently reconnecting.

Use `stopRead` and `stopWrite` channels to communicate
with sender / receive loops about . If channel close is initiated,
as indicated by a message to `stopRead` or `stopWrite`, don't send
errors on the error channel, which won't be read at that point anyway. Furthermore, add a small amount of buffering to the channels just to avoid possibility that a single message could inadvertently cause blocking.
@svix-daniel svix-daniel changed the title Remove reconnection interval in listen mode Improve CLI listen mode Feb 2, 2023
@svix-daniel svix-daniel changed the title Improve CLI listen mode Remove reconnection interval and prevent hanging Feb 2, 2023
@svix-james svix-james merged commit 497eb98 into main Feb 3, 2023
@svix-james svix-james deleted the daniel/reconnect-interval branch February 3, 2023 04:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants