fix: synchronize when resetting the keepalive timer#21
Merged
Conversation
320e99a to
c7ed5b3
Compare
willscott
reviewed
Mar 15, 2020
| func (s *Session) extendKeepalive() { | ||
| s.keepaliveLock.Lock() | ||
| if s.keepaliveTimer != nil && !s.keepaliveActive { | ||
| s.keepaliveTimer.Reset(s.config.KeepAliveInterval) |
Contributor
There was a problem hiding this comment.
"Reset should be invoked only on stopped or expired timers with drained channels." - do we know that's the case here?
Contributor
There was a problem hiding this comment.
already discussed in the previous pr...
Member
Author
There was a problem hiding this comment.
That's just bad documentation (#16 (comment)). Reset will actually call stop internally. The only reason you need to do it is if you need to drain the channel.
However, we're not even using a normal timer here.
vyzo
reviewed
Mar 15, 2020
4daa05b to
ae174bd
Compare
vyzo
approved these changes
Mar 15, 2020
ae174bd to
4f3f477
Compare
* fix races * fix timeouts * disable some tests when the race detector is enabled (too slow, too many goroutines)
4f3f477 to
345f639
Compare
Member
Author
|
Ok, tests aren't perfect but they're much better. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #20
Also, fix the tests, test in CI 5 times and one more time with the race detector.