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

exit 5 instead of raising error if no etcd endpoint responds #886

Merged
merged 4 commits into from
Jan 20, 2025

Conversation

viktorerlingsson
Copy link
Member

WHAT is this pull request doing?

Exit 5 (5th letter, E, for etcd) instead of raising error when no etcd endpoint responds.

fixes #872

HOW can this pull request be tested?

Try starting LavinMQ with clustering enabled and no etcd running.

@viktorerlingsson viktorerlingsson requested a review from a team as a code owner December 16, 2024 14:44
@carlhoerberg
Copy link
Member

I did this for exit 3: 5fd0ea0 So it won't exit specs.. it's not pretty though :/

@viktorerlingsson
Copy link
Member Author

I did this for exit 3: 5fd0ea0 So it won't exit specs.. it's not pretty though :/

Did the same here for now 👍

IMO let's go with that solution until we figure out something better!

@carlhoerberg
Copy link
Member

I reverted that, exiting in code, if the code is running in a fiber nothing would rescue and exit it.

@carlhoerberg
Copy link
Member

Check if we can override abort in specs

@viktorerlingsson
Copy link
Member Author

Check if we can override abort in specs

Yes we can, just something like the following in spec_helper works. But we should probably raise an exception that we can catch in the specs where we want LavinMQ to exit.

def abort(reason = "")
end

@spuun
Copy link
Member

spuun commented Jan 13, 2025

Yes we can, just something like the following in spec_helper works. But we should probably raise an exception that we can catch in the specs where we want LavinMQ to exit.

So we can just do:

def abort(reason = "")
raise reason
end

But maybe it's worth defining a SpecExitError or something.

@viktorerlingsson viktorerlingsson merged commit 3e26bfd into main Jan 20, 2025
23 of 25 checks passed
@viktorerlingsson viktorerlingsson deleted the exit-if-no-etcd branch January 20, 2025 09:53
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.

Crashes on startup if etcd isn't available
3 participants