diff options
| author | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2020-10-05 11:50:35 +0200 |
|---|---|---|
| committer | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2020-10-05 11:50:35 +0200 |
| commit | 6152c297a2244fe0235776f64585b36cef6dba8a (patch) | |
| tree | fe30e9ec9908e121ef599ce63b5e83f5ecc9c00f | |
| parent | b983ea6e9c444ecfa215871dce250c8562725e0f (diff) | |
| download | rabbitmq-server-git-6152c297a2244fe0235776f64585b36cef6dba8a.tar.gz | |
amqqueue: Pass `Type` to amqqueue_v1:new/9
amqqueue_v1:new/9 only accepts the classic queue type. Therefore, by
passing the type, we ensure that the request to create a v1 record with
a non-classic queue type will crash.
Before this change, amqqueue:new/9 with a non-classic queue type would
return "successfully" a classic queue record, effectively ignoring the
queue type argument.
This should help to detect missing dependency between feature flags. For
instance, the `stream_queue` feature flag would depend on the
`quorum_queue` feature flag because the latter introduced the v2 record
(the one with the `type` record member).
Without this change, it means that a user could request a new stream
queue (after enabling the `stream_queue` feature flag), but a classic
queue would be created instead. There would be no error.
Now, with this change, the request will crash. The same user can report
the bug: he enabled the `stream_queue` feature flag but the declare
crashes.
| -rw-r--r-- | src/amqqueue.erl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/amqqueue.erl b/src/amqqueue.erl index 8756f3fe10..3415ebd073 100644 --- a/src/amqqueue.erl +++ b/src/amqqueue.erl @@ -255,7 +255,8 @@ new(#resource{kind = queue} = Name, Owner, Args, VHost, - Options) + Options, + Type) end. -spec new_with_version |
