Closed
Description
When Socket.ConnectAsync
is cancelled it might lead to a deadlock.
The cancellation code for MultipleConnectAsync
tries to acquire a lock which is held by the connectAsync
continuation (triggered by DoDnsCallback
). The continuation then tries to dispose of the cancellation registration which will wait for all the callbacks if they've already been triggered.
This is easily reproducible with our HTTP stress suite (for HTTP 1.1 runs longer than 30 mins).
The biggest impact of this issue is that it prevents us from getting reasonable results from HTTP 1.1 stress pipeline on master. The pipeline gets cancelled on timeout and no results are available (AzDO empty logs).