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

Bugfix corrupt dlx headers #574

Merged
merged 4 commits into from
Sep 25, 2023
Merged

Conversation

viktorerlingsson
Copy link
Member

WHAT is this pull request doing?

Fixes a bug where messages that where dead-lettered multiple times would cause memory errors because of an issue in amq-protocol.cr - cloudamqp/amq-protocol.cr#14

HOW can this pull request be tested?

Run the spec.

spec/dlx_spec.cr Outdated
msg = wait_for { q.get }

x_death = msg.properties.headers.not_nil!["x-death"].as(Array(AMQ::Protocol::Field))
x_death.inspect
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
x_death.inspect

Copy link
Member Author

Choose a reason for hiding this comment

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

I kinda want that there so that the code would actually crash with amq-protocol 1.1.9. Without it this spec just fails the comparison, and I think it's safer to also know that we can output the whole array.

Copy link
Member Author

Choose a reason for hiding this comment

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

We could change it to x_death.inspect.should be_a(String) so it looks more like a spec I guess :)

@viktorerlingsson viktorerlingsson merged commit 45c2a2f into main Sep 25, 2023
21 of 23 checks passed
@viktorerlingsson viktorerlingsson deleted the bugfix_corrupt_dlx_headers branch September 25, 2023 17:07
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.

2 participants