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

Fix return value of rabbit_priority_queue:delete_crashed/1 (backport #13087) #13088

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Jan 16, 2025

Proposed Changes

According to the rabbit_backing_queue behavious it must always return ok, but it used to return a list of results one for each priority. That caused the below crash further up the call chain.

> rabbit_classic_queue:delete_crashed(Q)
** exception error: no case clause matching [ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok]
     in function  rabbit_classic_queue:delete_crashed/2 (rabbit_classic_queue.erl, line 516)

Other backing_queue implementations (rabbit_variable_queue) just exit with a badmatch upon error.

This (very minor) issue is present since 3.13.0 when rabbit_classic_queue:delete_crashed_in_backing_queue/1 was introduced with Khepri in commit 5f0981c. Before that the result of BQ:delete_crashed/1 was simply ignored.

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)
  • Build system and/or CI

Checklist

Put an x in the boxes that apply.
You can also fill these out after creating the PR.
If you're unsure about any of them, don't hesitate to ask on the mailing list.
We're here to help!
This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally with my changes
  • If relevant, I have added necessary documentation to https://github.com/rabbitmq/rabbitmq-website
  • If relevant, I have added this change to the first version(s) in release-notes that I expect to introduce it

Further Comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution
you did and what alternatives you considered, etc.


This is an automatic backport of pull request #13087 done by [Mergify](https://mergify.com).

According to the `rabbit_backing_queue` behavious it must always
return `ok`, but it used to return a list of results one for each
priority. That caused the below crash further up the call chain.

```
> rabbit_classic_queue:delete_crashed(Q)
** exception error: no case clause matching [ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok]
     in function  rabbit_classic_queue:delete_crashed/2 (rabbit_classic_queue.erl, line 516)
```

Other backing_queue implementations (`rabbit_variable_queue`) just
exit with a badmatch upon error.

This (very minor) issue is present since 3.13.0 when
`rabbit_classic_queue:delete_crashed_in_backing_queue/1` was
instroduced with Khepri in commit 5f0981c. Before that the result of
`BQ:delete_crashed/1` was simply ignored.

(cherry picked from commit efd4e45)
@michaelklishin michaelklishin added this to the 4.0.6 milestone Jan 16, 2025
@michaelklishin michaelklishin merged commit de236f5 into v4.0.x Jan 16, 2025
15 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v4.0.x/pr-13087 branch January 16, 2025 17:42
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