Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Websocket: Fix race on DataHandler during shutdown
Previously we would encounter situations where shutdown would race and fail TestConnectionMessageErrors, demonstrating that consumers might not be told why their connection is closing. * Do not drain DataHandler on dataMonitor shutdown Consumers should be allowed to process whatever messages were in flight prior to a socket shutdown * Ensure all DataHandler messages are sent to ToRoutine before shutdown This avoids a race where we'd read a message from DataHandler, but then process a shutdown before trying to relay it. The relay is non-blocking anyway, so we can trust that we'd pick up the Shutdown during the next loop. * Send errors to DataHandler before starting a shutdown This just reduces the chance of a race on shutdown processing
- Loading branch information