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

Increase the backoff strategy time #345

Merged
merged 2 commits into from
Jan 19, 2024

Conversation

Gsantomaggio
Copy link
Member

Per conversation with @acogoluegnes we want to have (more or less) the same Stream Java Client behaviour.

  • The back-off reconnect strategy is increased sensibly. The previous value was too aggressive. It caused a lot of tentative and a lot of server requests. The TCP port can be ready during the restart, but the stream cannot be ready due to the sync.

  • Introduce a random delay on the strategy to avoid having the same reconnection time in case the client has more producers and consumers.

  • Introduce also a random delay on the disconnected part on disconnect for the same above reason.

  • Fixes a bug: check the leader during the reconnection partition.

  • Introduce the TestBackOff strategy for the tests. The default value is too high for the tests

* The back-off reconnect strategy is increased sensibly.
  The previous value was too aggressive.
  It caused a lot of tentative and a lot of server requests.
  The TCP port can be ready during the restart, but the stream cannot be ready due to the sync.

* Introduce a random delay on the strategy to avoid having the same
  reconnection time in case the client has more producers and consumers.

* Introduce also a random delay on the disconnected part on disconnect for the same above reason.

Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
Copy link

codecov bot commented Jan 19, 2024

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (083ff20) 91.96% compared to head (9130e38) 91.86%.

Files Patch % Lines
RabbitMQ.Stream.Client/ClientExceptions.cs 33.33% 3 Missing and 1 partial ⚠️
Tests/Utils.cs 76.47% 3 Missing and 1 partial ⚠️
...bitMQ.Stream.Client/Reliable/IReconnectStrategy.cs 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #345      +/-   ##
==========================================
- Coverage   91.96%   91.86%   -0.11%     
==========================================
  Files         116      116              
  Lines       11264    11320      +56     
  Branches      895      897       +2     
==========================================
+ Hits        10359    10399      +40     
- Misses        701      718      +17     
+ Partials      204      203       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Gsantomaggio Gsantomaggio marked this pull request as ready for review January 19, 2024 14:31
@Gsantomaggio Gsantomaggio merged commit fa8f66b into main Jan 19, 2024
2 checks passed
@Gsantomaggio Gsantomaggio deleted the increase_connection_backoff_reconnection branch January 19, 2024 14:36
@Gsantomaggio Gsantomaggio added this to the 1.8.0 milestone Jan 22, 2024
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.

None yet

1 participant