When socket.ConnectAsync returns synchronously, driver assumes that it is connected

Description

The documentation of Socket.ConnectAsync says:

Returns "false" if the I/O operation completed synchronously. In this case, The "System.Net.Sockets.SocketAsyncEventArgs.Completed" event on the "e" parameter will not be raised and the "e" object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation.

But we are relying only on the Completed event to verify whether the connect operation was successful.

Here is an exception seen in the duration test logs:

This was reproduced with a test running on xenial against DSE-6.7.7 with netcoreapp2.1 target and .NET Core 2.2 SDK

Environment

None

Activity

Show:
Joao Reis
February 11, 2020, 7:02 PM

Flag added

merged to OSS

Joao Reis
February 13, 2020, 6:44 PM

Flag removed

merged to dse

Assignee

Unassigned

Reporter

Joao Reis

Labels

None

Reproduced in

None

PM Priority

None

Fix versions

External issue ID

None

Doc Impact

None

Reviewer

None

Pull Request

None

Epic Link

None

Sprint

Pull Requests

None

Size

None

Affects versions

Priority

Major
Configure