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

Do not overwrite default_queue_type with undefined #11457

Merged

Conversation

lukebakken
Copy link
Collaborator

Importing a definitions file with no default_queue_type metadata for a vhost will result in that vhosts value being set to undefined.

Once set to a non-undefined value, this PR prevents default_queue_type from being set back to undefined

@lukebakken lukebakken self-assigned this Jun 14, 2024
@lukebakken lukebakken force-pushed the lukebakken/vesc-1108-dont-overwrite-default_queue_type branch from 582d3d5 to b1c8a4b Compare June 14, 2024 18:04
@lukebakken
Copy link
Collaborator Author

@michaelklishin this PR will prevent default_queue_type from being set to undefined after it has been set at least once. Can you think of a scenario where we would want to set default_queue_type back to undefined? 🤔

@lukebakken lukebakken force-pushed the lukebakken/vesc-1108-dont-overwrite-default_queue_type branch 3 times, most recently from d986ead to d6774fe Compare June 14, 2024 20:32
@lukebakken lukebakken force-pushed the lukebakken/vesc-1108-dont-overwrite-default_queue_type branch from 636152e to 2739c35 Compare June 21, 2024 13:48
@lukebakken lukebakken marked this pull request as ready for review June 21, 2024 13:48
@lukebakken
Copy link
Collaborator Author

Re-requesting reviews from @michaelklishin and @ansd since I was out this week and just want a double-check before merging. Thanks gents.

Importing a definitions file with no `default_queue_type` metadata for a vhost will result in that vhosts value being set to `undefined`.

Once set to a non-`undefined` value, this PR prevents `default_queue_type` from being set back to `undefined`
@michaelklishin michaelklishin force-pushed the lukebakken/vesc-1108-dont-overwrite-default_queue_type branch from 2739c35 to 1cf5477 Compare June 21, 2024 15:25
@michaelklishin
Copy link
Member

The forced push was a rebase.

@lukebakken lukebakken merged commit 6ec0748 into main Jun 21, 2024
167 of 173 checks passed
@lukebakken lukebakken deleted the lukebakken/vesc-1108-dont-overwrite-default_queue_type branch June 21, 2024 17:04
michaelklishin added a commit that referenced this pull request Jun 22, 2024
In case 16, an await_condition/2 condition was
not correctly matching the error. As a result,
the function proceeded to the assertion step
earlier than it should have, failing with
an obscure function_clause.

This was because an {error, Context} clause
was not correct.

In addition to fixing it, this change adds a
catch-all clause and verifies the loaded
tagged virtual host before running any assertions
on it.

If the virtual host was not imported, case 16
will now fail with a specific CT log message.

References #11457 because the changes there
exposed this behavior in CI.
michaelklishin added a commit that referenced this pull request Jun 22, 2024
In case 16, an await_condition/2 condition was
not correctly matching the error. As a result,
the function proceeded to the assertion step
earlier than it should have, failing with
an obscure function_clause.

This was because an {error, Context} clause
was not correct.

In addition to fixing it, this change adds a
catch-all clause and verifies the loaded
tagged virtual host before running any assertions
on it.

If the virtual host was not imported, case 16
will now fail with a specific CT log message.

References #11457 because the changes there
exposed this behavior in CI.

(cherry picked from commit f515282)
michaelklishin added a commit that referenced this pull request Jun 22, 2024
In case 16, an await_condition/2 condition was
not correctly matching the error. As a result,
the function proceeded to the assertion step
earlier than it should have, failing with
an obscure function_clause.

This was because an {error, Context} clause
was not correct.

In addition to fixing it, this change adds a
catch-all clause and verifies the loaded
tagged virtual host before running any assertions
on it.

If the virtual host was not imported, case 16
will now fail with a specific CT log message.

References #11457 because the changes there
exposed this behavior in CI.
michaelklishin added a commit that referenced this pull request Jun 22, 2024
The queue type argument won't always be a binary,
for example, when a virtual host is created.

As such, the validation code should accept at
least atoms in addition to binaries.

While at it, improve logging and error reporting
when DQT validation fails, and while at it,
make the definition import tests focussed on
virtual host a bit more robust.
michaelklishin added a commit that referenced this pull request Jun 22, 2024
mergify bot pushed a commit that referenced this pull request Jun 22, 2024
The queue type argument won't always be a binary,
for example, when a virtual host is created.

As such, the validation code should accept at
least atoms in addition to binaries.

While at it, improve logging and error reporting
when DQT validation fails, and while at it,
make the definition import tests focussed on
virtual host a bit more robust.

(cherry picked from commit 1e577a8)

# Conflicts:
#	deps/rabbit/src/rabbit_vhost.erl
michaelklishin added a commit that referenced this pull request Jun 22, 2024
michaelklishin added a commit that referenced this pull request Jun 24, 2024
at validation time.

DQT = default queue type.

When a client provides no queue type, validation
should take the defaults (virtual host, global,
and the last resort fallback) into account
instead of considering the type to
be "undefined".

References #11457 ##11528
michaelklishin added a commit that referenced this pull request Jun 24, 2024
at validation time.

DQT = default queue type.

When a client provides no queue type, validation
should take the defaults (virtual host, global,
and the last resort fallback) into account
instead of considering the type to
be "undefined".

References #11457 ##11528
michaelklishin added a commit that referenced this pull request Jun 24, 2024
at validation time.

DQT = default queue type.

When a client provides no queue type, validation
should take the defaults (virtual host, global,
and the last resort fallback) into account
instead of considering the type to
be "undefined".

References #11457 ##11528
michaelklishin added a commit that referenced this pull request Jun 24, 2024
at validation time.

DQT = default queue type.

When a client provides no queue type, validation
should take the defaults (virtual host, global,
and the last resort fallback) into account
instead of considering the type to
be "undefined".

References #11457 ##11528
michaelklishin added a commit that referenced this pull request Jun 24, 2024
at validation time.

DQT = default queue type.

When a client provides no queue type, validation
should take the defaults (virtual host, global,
and the last resort fallback) into account
instead of considering the type to
be "undefined".

References #11457 ##11528
michaelklishin added a commit that referenced this pull request Jun 24, 2024
at validation time.

DQT = default queue type.

When a client provides no queue type, validation
should take the defaults (virtual host, global,
and the last resort fallback) into account
instead of considering the type to
be "undefined".

References #11457 ##11528
michaelklishin added a commit that referenced this pull request Jun 24, 2024
at validation time.

DQT = default queue type.

When a client provides no queue type, validation
should take the defaults (virtual host, global,
and the last resort fallback) into account
instead of considering the type to
be "undefined".

References #11457 ##11528
mergify bot pushed a commit that referenced this pull request Jun 24, 2024
at validation time.

DQT = default queue type.

When a client provides no queue type, validation
should take the defaults (virtual host, global,
and the last resort fallback) into account
instead of considering the type to
be "undefined".

References #11457 ##11528

(cherry picked from commit f3b7a34)

# Conflicts:
#	deps/rabbit/src/rabbit_queue_type.erl
#	deps/rabbit/src/rabbit_vhost.erl
michaelklishin added a commit that referenced this pull request Jun 24, 2024
at validation time.

DQT = default queue type.

When a client provides no queue type, validation
should take the defaults (virtual host, global,
and the last resort fallback) into account
instead of considering the type to
be "undefined".

References #11457 ##11528

(cherry picked from commit f3b7a34)

# Conflicts:
#	deps/rabbit/src/rabbit_queue_type.erl
#	deps/rabbit/src/rabbit_vhost.erl
@michaelklishin michaelklishin added this to the 3.13.4 milestone Jul 3, 2024
michaelklishin added a commit that referenced this pull request Aug 24, 2024
when virtual host does not have any metadata.

References #11541 #11457 #11528
michaelklishin added a commit that referenced this pull request Aug 24, 2024
mergify bot pushed a commit that referenced this pull request Aug 24, 2024
when virtual host does not have any metadata.

References #11541 #11457 #11528

(cherry picked from commit 29051a8)
mergify bot pushed a commit that referenced this pull request Aug 24, 2024
References #11541 #11457 #11528

(cherry picked from commit c41c27d)
mergify bot pushed a commit that referenced this pull request Aug 24, 2024
when virtual host does not have any metadata.

References #11541 #11457 #11528

(cherry picked from commit 29051a8)
(cherry picked from commit f90a4e1)
mergify bot pushed a commit that referenced this pull request Aug 24, 2024
References #11541 #11457 #11528

(cherry picked from commit c41c27d)
(cherry picked from commit bd6097f)

# Conflicts:
#	deps/rabbitmq_amqp_client/test/management_SUITE.erl
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