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

fix(nats): wait for reconnects on setup #440

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

Conversation

hspedro
Copy link
Collaborator

@hspedro hspedro commented Jan 27, 2025

Ported from v2 #439

If the initial connect fails, NATS will spawn reconnect async handlers. Thus, we need to wait for all reconnects to be attempted before returning to the caller, otherwise, we won't be making use of reconnections.

  • fix(app): init sig chan as buffered
  • fix(etcd): prevent shutdown from crashing app

If the etcd module shuts down before all connections are set up, it will crash trying to access sd.cli where it's still nil. Thus, adding a check on shutdown

If the initial connect fails, nats will spawn reconnect async
handlers. Thus, we need to wait for all reconnects to be attempted
before returning to the caller, otherwise we won't be making
use of reconnections
If etcd module is shutdown before all connections are set up,
it will crash trying to access sd.cli where it's still nil. Thus
adding a check on shutdown
@hspedro hspedro self-assigned this Jan 27, 2025
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.

1 participant