Repository navigation
fix(metrics): a cache refresh's provider calls are not the run's (#1145) - #1147
Merged
Merged
Conversation
The run-scoped call counter is process-global, so a team/league cache refresh overlapping a generation was attributed to the run (1,110 calls against a normal 480 on a run triggered seconds after a restart). The refresher now runs under call_metrics.excluded() and its two worker pools mark their threads with exclude_current_thread; the record functions ignore an excluded thread.
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.
The provider call counter behind the run history API Calls column is process-global, so a team/league cache refresh (startup, daily, or the manual button) running alongside a generation added its calls to the run: 1,110 against a normal 480 on a run triggered seconds after a container restart, with
espn:teams352 andespn:groups93 belonging to the refresh.call_metrics: thread-local exclusion.excluded()context manager for a thread that outlives the work (a scheduler thread must count again afterwards),exclude_current_threadas aThreadPoolExecutorinitializer for worker pools.record_call/record_rate_limit/record_failurereturn early on an excluded thread.CacheRefresher.refreshruns underexcluded(); both of its worker pools carry the initializer.