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

feat: zombie connection check #173

Merged
merged 1 commit into from
Apr 9, 2024
Merged

feat: zombie connection check #173

merged 1 commit into from
Apr 9, 2024

Conversation

ThePedroo
Copy link
Contributor

Notice

  • I understand the code that I have edited, and have the means
    to test it before making changes to Concord.

What?

This PR introduces checks that ensures that the previous heartbeat was responded.

Why?

This avoids keeping a zombie connection, where the connection is over, however the client (Concord) is unaware of that for some reason. Heartbeats are meant for this, and should be used as it.

How?

This introduces a hbeat_answered field, that defines whether or not the previous heartbeat was answered/responded.

Testing?

Basic testing was done. However better testing should be done, and the code should be reviewed as well.

Anything Else?

While I believe it's important this PR, the reason for a lot of times Concord be unaware of closes may be to cws. I'll investigate further.

This commit adds the check that verifies if the connection is dead, AKA zombie. Without this, once internet was unavailable for a certain time, Discord would stop responding to the heartbeats and wouldn't send any events, causing to the bot be offline, while the process would be still alive.
@lcsmuller lcsmuller merged commit 89007ce into dev Apr 9, 2024
2 checks passed
@lcsmuller lcsmuller deleted the feat/zombie-check branch April 9, 2024 02:03
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.

2 participants