nats-io / nats.c

A C client for NATS
Apache License 2.0
382 stars 132 forks source link

[Added] natsConnection_Reconnect #757

Closed levb closed 3 months ago

levb commented 3 months ago

Simplified version of https://github.com/nats-io/nats.c/pull/756

codecov[bot] commented 3 months ago

Codecov Report

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

Project coverage is 68.75%. Comparing base (3f02b1d) to head (5884592). Report is 1 commits behind head on main.

:exclamation: Current head 5884592 differs from pull request most recent head e85d0b7. Consider uploading reports for the commit e85d0b7 to get more accurate results

Files Patch % Lines
src/conn.c 76.92% 0 Missing and 3 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #757 +/- ## ========================================== + Coverage 68.72% 68.75% +0.02% ========================================== Files 39 39 Lines 15176 15189 +13 Branches 3137 3140 +3 ========================================== + Hits 10430 10443 +13 + Misses 1695 1692 -3 - Partials 3051 3054 +3 ```

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

levb commented 3 months ago

https://synadiacommunications.slack.com/archives/C05CGNTKNF2/p1715003032479599?thread_ts=1715000908.579469&cid=C05CGNTKNF2

image

So, so special treatment, do not return an error from Reconnect if allowReconnect==false, just kill the socket and let the client do what it does (error out).

levb commented 3 months ago

@kozlovic yes, I knew it when I committed. I was hoping to soon get the word from @jnmoyne that the timeout can be shortened, but yes, let me at least make all the "long" tests run once. TBH I am yet to see any new flakes appear from the x3 change, so maybe it should be changed back to x1 for all, like it was before.