-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
testPresentTimeout
subtest of TestConn
, fix possible memory leak
Regarding memory leak. In the `Write` method of the route group we call `writePacketAsync`. It returns `errCh` to us to wait the error from, this channel is not buffered, so `writePacketAsync`'s goroutine actually blocks while trying to pass error to this channel. But `Write` blocks on `select` waiting either error from `errCh` or error from write deadline struct. And if it gets deadline error, it just returns without waiting for any error from `errCh`, making `writePacketAsync` block forever on sending to the channel. And we might have had a lot of such running goroutines
- Loading branch information
Showing
3 changed files
with
41 additions
and
29 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.