You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While looking into #61269, I noticed what looks like a dangerous pattern in the poller implementation.
The poller uses context.WithTimeout to add a timeout for the configured Getter. Unfortunately, it sets that timeout to be exactly equal to the configured period: if the Getter runs within that period everything is fine, but if it starts taking marginally longer than the period, it is likely that every call will fail with a deadline exceeded error and whatever the poller is supposed to be doing will fail to make progress: https://cs.opensource.google/go/x/pkgsite/+/master:internal/poller/poller.go;l=49;drc=694b5d3c2a971c2a1dcdf7ab34e521b762bd326d
Instead, I would generally expect the Getter to be invoked with the same Context that controls the lifetime of the poller overall, so that it will only fail if the Poller is being shut down.
(However, it might make sense to also invoke the onError callback as soon as the call overruns the period, so that it can trigger any monitoring that hooks into that callback.)
The text was updated successfully, but these errors were encountered:
While looking into #61269, I noticed what looks like a dangerous pattern in the
poller
implementation.The
poller
usescontext.WithTimeout
to add a timeout for the configuredGetter
. Unfortunately, it sets that timeout to be exactly equal to the configured period: if theGetter
runs within that period everything is fine, but if it starts taking marginally longer than the period, it is likely that every call will fail with adeadline exceeded
error and whatever the poller is supposed to be doing will fail to make progress:https://cs.opensource.google/go/x/pkgsite/+/master:internal/poller/poller.go;l=49;drc=694b5d3c2a971c2a1dcdf7ab34e521b762bd326d
Instead, I would generally expect the
Getter
to be invoked with the sameContext
that controls the lifetime of the poller overall, so that it will only fail if thePoller
is being shut down.(However, it might make sense to also invoke the
onError
callback as soon as the call overruns the period, so that it can trigger any monitoring that hooks into that callback.)The text was updated successfully, but these errors were encountered: