gftea / amqprs

Async & Lock-free RabbitMQ Rust Client, Easy-to-use API
MIT License
214 stars 27 forks source link

feat(read_handler): log when max hearbeat missed #151

Closed RoloEdits closed 1 week ago

RoloEdits commented 1 week ago

This can be useful when debugging if the limit was reached, otherwise there is no easy way to tell.

Also fixed some typos.

RoloEdits commented 1 week ago

I'm also wondering if maybe we should change

error!("missing heartbeat from server for {}", self.amqp_connection);

to a warn instead?

michaelklishin commented 1 week ago

@RoloEdits two missed heartbeats (and it's usually two or zero, very rarely just one) per AMQP 0-9-1 spec require the client (or server) to close the connection. So both a warning and an error can be appropriate assuming that right before closing the connection, this client will log a relevant error of sorts.

RoloEdits commented 1 week ago

Yeah, currently when its just one miss, which isn't the end of the world, its logged as an error, which when filtering can make things pretty noisy depending on the sink you are using. A warn makes more sense to me in this case. The actual error would be the connection closing due to the misses.

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 86.48%. Comparing base (de3c858) to head (27563e5). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
amqprs/src/net/reader_handler.rs 0.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #151 +/- ## ======================================= Coverage 86.47% 86.48% ======================================= Files 40 40 Lines 6619 6620 +1 ======================================= + Hits 5724 5725 +1 Misses 895 895 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

gftea commented 1 week ago

@RoloEdits thanks!