fix: properly handle heartbeat timeouts (#95)#132
Merged
carlhoerberg merged 1 commit intomainfrom May 28, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR addresses heartbeat timeout handling by properly closing the connection when a timeout event occurs and by managing socket timeouts based on heartbeat settings.
- Updated the AMQP client's timeout event handler to trigger disconnection on heartbeat timeout.
- Added a new test to simulate and verify the heartbeat timeout behavior.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/test.ts | Added a test to simulate and validate heartbeat timeout events. |
| src/amqp-socket-client.ts | Updated the socket timeout event handler to close the connection on heartbeat timeout. |
Contributor
antondalgren
left a comment
There was a problem hiding this comment.
I don't understand where the double heartbeat comes from as Copilot stated. Otherwise I think it looks good.
Member
Author
|
It originally came from the issue: #95 but it's not correct, it shouldn't be double. |
On heartbeat timeout only the next RPC action was rejected, now `onerror` is called and the socket is closed. Fixes #95
38d1c5e to
b9d8680
Compare
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.
🤖 Generated with Claude Code