Bugfix: crash during startup because of missing 'x-delayed-type' #620
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WHAT is this pull request doing?
If a delayed exchange was declared with
type=x-delayed-message
andarguments={x-delayed-type: '…'}
and LavinMQ crashed before definitions has been compacted, it couldn't start again because of:Unhandled exception: Missing required argument 'x-delayed-type' (LavinMQ::Error::ExchangeTypeError)
In LavinMQ any exchange can be delayed by specifiy
x-delayed-exchange: true
in exchange arguments, and declare frames withtype=x-delayed-message
was converted totype=<value of x-delayed-type>
witharguments={x-delayed-exchange: true}
. However, the original frame was stored to the definition file, but with modified arguments causing the crash on startup, i.e. the frame hadtype=x-delayed-message
but nox-delayed-type
in the arguments table.This change will make sure to clone the arguments table before modifying it.
HOW can this pull request be tested?
Specs, or run lavinmq and declare a delayed exchange with
type=x-delayed-message
then kill -9 lavinmq and try start it.