Closed wangchen615 closed 3 years ago
Issue is with fetches below from windowWatcher()
which run in separate go routine:
for _, duration := range durations {
go windowWatcher(duration)
}
This may cause the metrics to be unavailable for a very short moment initially when using load watcher as a library. To fix this, the first fetch should be made synchronously, and subsequent fetches should use goroutines. Thanks for reporting @wangchen615
The current design of
libraryClient
in the release version includeswatcher
as follows:Watcher libraries should only be used for load-watcher.
libraryClient
should not include starting the watcher when thelibraryClient
is also used by scheduler plugins.The LibraryClient failed to getLatestMetrics when using it in plugins without
select {}
.