Skip to content

Commit 7035c17

Browse files
mkuratczykmergify[bot]
authored andcommitted
Set settle modes in link error frames
Follow-up to #14389 Without these changes, the attach frame doesn't set any settlement mode. This leads to settlement negotiation errors hiding the actual error. For example, omq amqp -y 0 -t /queues/no-such-queue omq amqp -x 0 -T /queues/no-such-queue Returned `amqp: sender settlement mode "unsettled" requested, received "mixed" from server"`, when the actual error in the next (detach) frame was `amqp:not-found`. However, the attach frame triggers a client-side error before the detach frame is processed. (cherry picked from commit f261afc)
1 parent 980a6ce commit 7035c17

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

deps/rabbit/src/rabbit_amqp_session.erl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,9 @@ handle_frame(#'v1_0.attach'{name = {utf8, NameBin} = Name,
11451145
handle = Handle,
11461146
role = Role,
11471147
source = Source,
1148-
target = Target} = Attach,
1148+
target = Target,
1149+
snd_settle_mode = SndSettleMode,
1150+
rcv_settle_mode = RcvSettleMode} = Attach,
11491151
State) ->
11501152
try
11511153
ok = validate_attach(Attach),
@@ -1161,15 +1163,19 @@ handle_frame(#'v1_0.attach'{name = {utf8, NameBin} = Name,
11611163
handle = Handle,
11621164
role = ?AMQP_ROLE_RECEIVER,
11631165
source = Source,
1164-
target = null};
1166+
target = null,
1167+
snd_settle_mode = SndSettleMode,
1168+
rcv_settle_mode = RcvSettleMode};
11651169
?AMQP_ROLE_RECEIVER ->
11661170
#'v1_0.attach'{
11671171
name = Name,
11681172
handle = Handle,
11691173
role = ?AMQP_ROLE_SENDER,
11701174
source = null,
11711175
target = Target,
1172-
initial_delivery_count = ?UINT(?INITIAL_DELIVERY_COUNT)}
1176+
initial_delivery_count = ?UINT(?INITIAL_DELIVERY_COUNT),
1177+
snd_settle_mode = SndSettleMode,
1178+
rcv_settle_mode = RcvSettleMode}
11731179
end,
11741180
Detach = #'v1_0.detach'{handle = Handle,
11751181
closed = true,

0 commit comments

Comments
 (0)