Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix data race will accessing connection in partitionConsumer
The partitionConsumer maintains a few internal go-routines, two of which access the underlying internal.Connection. The main runEvenstLoop() go-routine reads the connection field while a separate go-routine is used to detect connection loss, initiate re-connection, and set the connection. The go-routine that initiates re-connection on connection loss was added in the following PR in order to address a deadlock: #535 The above PR also includes the following changes: * connection drains and fails the incomingRequestsCh when the conneciton is closed. * partitionConsumer uses a separate channel to communicate connection loss to the re-connection go-routine. With the above it in place it is possible for the partitionConsumer to handle the connection loss in the main runEventsLoop(), allowing us to use a single go-routine to manage the connection and resolve the data race. Signed-off-by: Daniel Ferstay <[email protected]>
- Loading branch information