-
Notifications
You must be signed in to change notification settings - Fork 43
implement a Transport.Close that waits for the reuse's GC to finish #211
Conversation
reuse.go
Outdated
defer r.mutex.Unlock() | ||
close(r.closeChan) | ||
if r.garbageCollectorRunning { | ||
<-r.garbageCollectorStopChan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can deadlock if we're waiting for the garbage collection routine to take the lock.
I removed the rather complicated logic of starting and stopping the reuse gc function. Now that we have a clean shutdown procedure, this won't be necessary any more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the rather complicated logic of starting and stopping the reuse gc function. Now that we have a clean shutdown procedure, this won't be necessary any more.
We're still stopping the garbage collector when we have no more connections. We need to remove that if we're going to remove the auto start/stop feature.
1dffa32
to
6b335d5
Compare
Oops, must have missed that. Fixed. |
LGTM but there's a test failure we should probably investigate. |
Looks unrelated, I opened #213. |
This finally makes it possible to run tests with race detector, and therefore switch to the Unified CI Setup.
Not sure if the implementation of
Transport.Close
here is sufficient to fix #176 though.