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

[FIXED] Call ConnectedCB with RetryOnFailedConnect when initial conn failed #1619

Merged
merged 3 commits into from
Apr 22, 2024

Conversation

piotrpio
Copy link
Collaborator

This fixes an issue when ConnectedCB is not called when using RetryOnFailedConnect and the first attempt to connect fails but subsequent retry is successful.

Previously ReconnectedCB was invoked in such case.

Signed-off-by: Piotr Piotrowski piotr@synadia.com

@ripienaar
Copy link
Contributor

I don't think its a breaking change, sure people can depend on this behaviour but it is clearly wrong, so I think its ok to fix the bug imo.

@piotrpio piotrpio marked this pull request as ready for review April 19, 2024 11:58
Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

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

Looks good, just one fmt leftover.

nats.go Outdated
if nc.Opts.ReconnectedCB != nil && !nc.initc {
nc.ach.push(func() { nc.Opts.ReconnectedCB(nc) })
} else if nc.Opts.ConnectedCB != nil && nc.initc {
fmt.Println()
Copy link
Member

Choose a reason for hiding this comment

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

A leftover after tests?

…failed

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

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

LGTM!

@piotrpio piotrpio merged commit 8894a27 into main Apr 22, 2024
2 checks passed
@piotrpio piotrpio deleted the fix-connected-cb branch April 22, 2024 12:15
@piotrpio piotrpio mentioned this pull request May 17, 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

3 participants