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

rescue if lavinmq starts with faulty msg_store #865

Merged
merged 5 commits into from
Dec 9, 2024
Merged

Conversation

kickster97
Copy link
Member

WHAT is this pull request doing?

today if we get an error when initialising the message store in load_segments_from_disk and load_stats_from_segments we will raise an exception and LavinMQ will not be able to start. With these changes we will instead just close the queue and let LavinMQ start up with closed queues.

HOW can this pull request be tested?

try to start up with a faulty msg_store.

@kickster97 kickster97 requested a review from a team as a code owner December 3, 2024 11:07
Copy link
Member

@viktorerlingsson viktorerlingsson left a comment

Choose a reason for hiding this comment

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

Added a couple of comments about log message, otherwise it looks good to me!

src/lavinmq/amqp/queue/message_store.cr Outdated Show resolved Hide resolved
src/lavinmq/amqp/queue/message_store.cr Outdated Show resolved Hide resolved
Comment on lines 350 to 351
rescue ex
@log.error { "Closing message store: invalid SchemaVersion in #{path}" }
Copy link
Member

Choose a reason for hiding this comment

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

how do we know that it is a "invalid SchemaVersion" error if we catch all errors? aren't we raising a specific exception then? Catch only that then, or log ex.message.

src/lavinmq/amqp/queue/queue.cr Show resolved Hide resolved
@kickster97 kickster97 merged commit e425466 into main Dec 9, 2024
22 of 25 checks passed
@kickster97 kickster97 deleted the rescue-closed-queue branch December 9, 2024 08:08
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.

4 participants