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(read_handler): log when max hearbeat missed #151

Merged
merged 5 commits into from
Oct 26, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions amqprs/src/net/reader_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
match res {
Ok((channel_id, frame)) => {
if let Err(err) = self.handle_frame(channel_id, frame).await {
// notifiy network failure
// notify network failure
is_network_failure = true;
#[cfg(feature="traces")]
error!("socket will be closed due to error of handling frame, cause: {}", err);
Expand All @@ -275,7 +275,7 @@
}
},
Err(err) => {
// notifiy network failure
// notify network failure

Check warning on line 278 in amqprs/src/net/reader_handler.rs

View check run for this annotation

Codecov / codecov/patch

amqprs/src/net/reader_handler.rs#L278

Added line #L278 was not covered by tests
is_network_failure = true;
#[cfg(feature="traces")]
error!("socket will be closed due to failure of reading frame, cause: {}", err);
Expand All @@ -291,9 +291,11 @@

// should call self.io_failure_notify.notify_one();?
#[cfg(feature="traces")]
error!("missing heartbeat from server for {}", self.amqp_connection);
warn!("missing heartbeat from server for {}", self.amqp_connection);

Check warning on line 294 in amqprs/src/net/reader_handler.rs

View check run for this annotation

Codecov / codecov/patch

amqprs/src/net/reader_handler.rs#L294

Added line #L294 was not covered by tests
RoloEdits marked this conversation as resolved.
Show resolved Hide resolved
heartbeat_miss += 1;
if heartbeat_miss >= MAX_HEARTBEAT_MISS {
#[cfg(feature="traces")]
error!("heartbeat was missed `{heartbeat_miss}` times in a row, closing connection");

Check warning on line 298 in amqprs/src/net/reader_handler.rs

View check run for this annotation

Codecov / codecov/patch

amqprs/src/net/reader_handler.rs#L298

Added line #L298 was not covered by tests
// Shutdown connection due to heartbeat timeout
is_network_failure = true;
break;
Expand Down
Loading