Skip to content

DO NOT MERGE rabbitmq_shovel: delay closing amqp10 source connection#15603

Draft
dcorbacho wants to merge 1 commit intomainfrom
shovel-close-conn-flake
Draft

DO NOT MERGE rabbitmq_shovel: delay closing amqp10 source connection#15603
dcorbacho wants to merge 1 commit intomainfrom
shovel-close-conn-flake

Conversation

@dcorbacho
Copy link
Contributor

When using an autodelete shovel, acks to source might still be in-flight when the connections start to close. Let's give them a short buffer to finish sending acks and then close.

shovel_dynamic_SUITE:autodelete_classic_on_publish_with_rejections/1 often flakes in CI because of this

@dcorbacho dcorbacho requested a review from mkuratczyk March 2, 2026 13:17
When using an autodelete shovel, acks to source might still be in-flight
when the connections start to close. Let's give them a short buffer
to finish sending acks and then close.
@dcorbacho dcorbacho force-pushed the shovel-close-conn-flake branch from bf2a896 to 6be77f9 Compare March 2, 2026 13:49
Comment on lines -394 to +403
_ = amqp10_client:end_session(Sess),
_ = amqp10_client:close_connection(Conn),
%% Wait for pending acks/nacks to be delivered
_ = timer:apply_after(10_000, ?MODULE, connection_close, [Conn, Sess]),
ok;
close_source(_Config) -> ok.

connection_close(Conn, Sess) ->
_ = amqp10_client:end_session(Sess),
_ = amqp10_client:close_connection(Conn).

Copy link
Member

Choose a reason for hiding this comment

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

The link should be detached first.

Copy link
Member

Choose a reason for hiding this comment

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

Detaching the link will cause acks to be delivered to the quorum queue before the quorum queue removes the consumer:

State1 = send_pending(Cid, State0),

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