jameshartig commented on code in PR #1767:
URL: 
https://github.com/apache/cassandra-gocql-driver/pull/1767#discussion_r1936637570


##########
host_source.go:
##########
@@ -747,25 +747,27 @@ const (
 // debounces requests to call a refresh function (currently used for ring 
refresh). It also supports triggering a refresh immediately.
 type refreshDebouncer struct {
        mu           sync.Mutex
-       stopped      bool
        broadcaster  *errorBroadcaster
        interval     time.Duration
        timer        *time.Timer
        refreshNowCh chan struct{}
-       quit         chan struct{}
        refreshFn    func() error
+       quitCtxFn    context.CancelFunc

Review Comment:
   I would say this is a bit of an abuse of contexts. Instead I would keep the 
old behavior but just change a small thing. Add another `chan struct{}` here 
called `done` that is `defer close(done)` in flusher. Then in `stop()` keep 
what was there but don't write to `quit` (I'm not really sure what the purpose 
of that was anyways) and just close it. Then do `<-done` to wait for `flusher` 
to stop.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to