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

Refactor some JetStream helper code, add support for specifying JetStream domain #3485

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

neilalexander
Copy link
Contributor

@neilalexander neilalexander commented Dec 31, 2024

This should gracefully handle some more potential errors that the consumer fetches can return with retries, as well as setting some client settings for reconnects etc when using an external NATS Server.

Also allow specifying the JetStream domain in case of a leafnode scenario and better manage client reuse across Dendrite. And also update NATS Server to 2.10.24 for good measure.

This code is backported from Harmony.

Signed-off-by: Neil Alexander [email protected]

@neilalexander neilalexander requested a review from a team as a code owner December 31, 2024 21:36
@codecov-commenter
Copy link

codecov-commenter commented Dec 31, 2024

Codecov Report

Attention: Patch coverage is 55.00000% with 45 lines in your changes missing coverage. Please review.

Project coverage is 49.38%. Comparing base (add73ec) to head (d7a22b7).

Files with missing lines Patch % Lines
setup/jetstream/nats.go 38.09% 20 Missing and 6 partials ⚠️
setup/jetstream/helpers.go 67.24% 15 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3485      +/-   ##
==========================================
- Coverage   49.39%   49.38%   -0.02%     
==========================================
  Files         524      524              
  Lines       59737    59751      +14     
==========================================
- Hits        29507    29506       -1     
- Misses      26748    26760      +12     
- Partials     3482     3485       +3     
Flag Coverage Δ
unittests 49.38% <55.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Comment on lines +88 to +92
} else if err.Error() == "nats: Server Shutdown" {
// The server is shutting down, but we'll rely on reconnect
// behaviour to try and either connect us to another node (if
// clustered) or to reconnect when the server comes back up.
continue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully fixes #3177 (cc @recht)

setup/jetstream/nats.go Outdated Show resolved Hide resolved
Signed-off-by: Neil Alexander <[email protected]>
@S7evinK
Copy link
Contributor

S7evinK commented Jan 2, 2025

Sytest is unhappy until #3471 is merged.

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.

3 participants