Connection.Start in the .NET client re-initializes state variables regardless of the connection status #2675

Closed
DamianEdwards opened this Issue Nov 1, 2013 · 1 comment

Comments

Projects
None yet
2 participants
Owner

DamianEdwards commented Nov 1, 2013

Found during work on on fix for #2653

The Connection.Start method in the .NET client initializes instance state variables, e.g. _startTcs, before checking the state of the connection.

This means that if you call Start().Wait() twice in a row, the second call to Start will blast away the state of the connection, resulting in strange errors (as the internal state is now essentially in a corrupt state).

DamianEdwards was assigned Nov 4, 2013

@DamianEdwards DamianEdwards added a commit that referenced this issue Nov 5, 2013

@DamianEdwards DamianEdwards Ensure calling connection.Start() multi times is safe in .NET client:
- Don't initialize the connection state unless we're actually starting
- Added a unit test to verify calling Start() multiple times doesn't corrupt the connection
- #2675
3a12207

@DamianEdwards DamianEdwards added a commit that referenced this issue Nov 5, 2013

@DamianEdwards DamianEdwards Ensure calling connection.Start() multi times is safe in .NET client:
- Don't initialize the connection state unless we're actually starting
- Added a unit test to verify calling Start() multiple times doesn't corrupt the connection
- #2675
36cdfb4
Contributor

gustavo-armenta commented Nov 7, 2013

ran test ConnectionFunctionsCorrectlyAfterCallingStartMutlipleTimes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment