Skip to content

Commit

Permalink
Ensure all connections are closed regardless of exception (#254)
Browse files Browse the repository at this point in the history
* Ensure all connections are closed using finally

* Execute closing of connection after catching exceptions but without finally

* Remove and improve extra spacing

* Revert to original behavior for closing connection for any exception
  • Loading branch information
glebvsmir authored Mar 7, 2024
1 parent 38e7c4a commit fe19ec5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Pulsar.Client/Internal/ClientCnx.fs
Original file line number Diff line number Diff line change
Expand Up @@ -840,8 +840,7 @@ and internal ClientCnx (config: PulsarClientConfiguration,
if initialConnectionTsc.TrySetException(ConnectException("Unable to initiate connection")) then
Log.Logger.LogWarning("{0} New connection was aborted", prefix)
Log.Logger.LogWarning(ex, "{0} Socket was disconnected exceptionally while reading", prefix)
post operationsMb ChannelInactive

post operationsMb ChannelInactive
Log.Logger.LogDebug("{0} readSocket stopped", prefix)
} :> Task

Expand Down

0 comments on commit fe19ec5

Please sign in to comment.