Skip to content

Commit f261afc

Browse files
committed
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.
1 parent 6e7cb4d commit f261afc

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
@@ -1136,7 +1136,9 @@ handle_frame(#'v1_0.attach'{name = {utf8, NameBin} = Name,
11361136
handle = Handle,
11371137
role = Role,
11381138
source = Source,
1139-
target = Target} = Attach,
1139+
target = Target,
1140+
snd_settle_mode = SndSettleMode,
1141+
rcv_settle_mode = RcvSettleMode} = Attach,
11401142
State) ->
11411143
try
11421144
ok = validate_attach(Attach),
@@ -1152,15 +1154,19 @@ handle_frame(#'v1_0.attach'{name = {utf8, NameBin} = Name,
11521154
handle = Handle,
11531155
role = ?AMQP_ROLE_RECEIVER,
11541156
source = Source,
1155-
target = null};
1157+
target = null,
1158+
snd_settle_mode = SndSettleMode,
1159+
rcv_settle_mode = RcvSettleMode};
11561160
?AMQP_ROLE_RECEIVER ->
11571161
#'v1_0.attach'{
11581162
name = Name,
11591163
handle = Handle,
11601164
role = ?AMQP_ROLE_SENDER,
11611165
source = null,
11621166
target = Target,
1163-
initial_delivery_count = ?UINT(?INITIAL_DELIVERY_COUNT)}
1167+
initial_delivery_count = ?UINT(?INITIAL_DELIVERY_COUNT),
1168+
snd_settle_mode = SndSettleMode,
1169+
rcv_settle_mode = RcvSettleMode}
11641170
end,
11651171
Detach = #'v1_0.detach'{handle = Handle,
11661172
closed = true,

0 commit comments

Comments
 (0)