-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't try to read/write if connection is closed
There appears to be an issue on OS X where the following sequence of events occurs, leading to a deadlock: 1. Remote side closes its connection 2. Local side receives io.EOF trying to read the next frame 3. Local idleAwareFramer monitor goroutine exits, so nothing is receiving from resetChan any more 4. Code using spdystream isn't aware of the EOF and tries to Reset() all streams and Close() the connection 5. The attempt to write the stream reset frame does not return an error when it logically should 6. The idleAwareFramer tries to send to the resetChan 7. In some instances, resetChan's buffer is full (because the monitor isn't running any more) 8. We block here To address this, add checks at the beginning of ReadFrame and WriteFrame in idleAwareFramer to see if the connection's closeChan is closed. If so, immediately return an error instead of trying to read/write using the underlying framer. Also remove some timeouts in the test code - these should be handled by passing -test.timeout to the test executable instead. Signed-off-by: Andy Goldstein <agoldste@redhat.com>
- Loading branch information
Andy Goldstein
committed
Mar 9, 2015
1 parent
e9bf991
commit b069eac
Showing
2 changed files
with
118 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters