Skip to content

Commit 03995b5

Browse files
Backed out changeset 39d010399f9d
When network connection fails right before a connection negotiation/tuning frame is sent, we want OperationInterruptedException to be thrown and not AlreadyClosedException. SessionBase#Transmit will throw the latter, if we handle it, method continuation will eventually throw an OIE.
1 parent 89f29d1 commit 03995b5

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

projects/client/RabbitMQ.Client/src/client/impl/ModelBase.cs

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,8 +1397,15 @@ public ConnectionSecureOrTune ConnectionStartOk(IDictionary<string, object> clie
13971397
{
13981398
ConnectionStartRpcContinuation k = new ConnectionStartRpcContinuation();
13991399
Enqueue(k);
1400-
_Private_ConnectionStartOk(clientProperties, mechanism,
1400+
try
1401+
{
1402+
_Private_ConnectionStartOk(clientProperties, mechanism,
14011403
response, locale);
1404+
}
1405+
catch (AlreadyClosedException)
1406+
{
1407+
// Ignored, see BasicGet
1408+
}
14021409
k.GetReply();
14031410
return k.m_result;
14041411
}
@@ -1420,7 +1427,14 @@ public ConnectionSecureOrTune ConnectionSecureOk(byte[] response)
14201427
{
14211428
ConnectionStartRpcContinuation k = new ConnectionStartRpcContinuation();
14221429
Enqueue(k);
1423-
_Private_ConnectionSecureOk(response);
1430+
try
1431+
{
1432+
_Private_ConnectionSecureOk(response);
1433+
}
1434+
catch (AlreadyClosedException)
1435+
{
1436+
// Ignored, see BasicGet
1437+
}
14241438
k.GetReply();
14251439
return k.m_result;
14261440
}
@@ -1459,7 +1473,13 @@ public string ConnectionOpen(string virtualHost,
14591473
{
14601474
ConnectionOpenContinuation k = new ConnectionOpenContinuation();
14611475
Enqueue(k);
1462-
_Private_ConnectionOpen(virtualHost, capabilities, insist);
1476+
try {
1477+
_Private_ConnectionOpen(virtualHost, capabilities, insist);
1478+
}
1479+
catch (AlreadyClosedException)
1480+
{
1481+
// Ignored, see BasicGet
1482+
}
14631483
k.GetReply();
14641484
if (k.m_redirect) {
14651485
throw new RedirectException(m_session.Connection.Protocol,

0 commit comments

Comments
 (0)