This repository has been archived by the owner on Aug 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 105
use Context's properly to stop executing when a request is canceled #728
Merged
Commits on Nov 21, 2017
-
use context.Context's properly stop executing when a request is canceled
- The ctx was already being passed between the different methods within the query pipeline, but the context was never being inspected to see if it had been canceled. This commit fixes that. - Now when an error occurs, whether that error is local or on a remote peer, the request is immediately canceled. - if the client disconnects before a response is returned (whether that is due to a timeout or the client canceling the request), that cancelation will propagate throught and abort any work.
woodsaj committedNov 21, 2017 Configuration menu - View commit details
-
Copy full SHA for 2319ad7 - Browse repository at this point
Copy the full SHA 2319ad7View commit details -
add per request ratelimiting of getTargetsLocal
limit the number of getTargetsLocal threads that can be running at once. This ensures that if a large query that spans 1000s of series is executed, 1000s of goroutines wont be run at once to hit the caches and cassandra. This also ensures that a single query cant fill the cassandra read queue. Mt only executes cassandra-read-concurrency requests at a time so requests will always need to be queued. With this new approach multiple render requests will share read queue and their read requests will be interspaced in the queue, rather then the old behaviour where a render request would have to complete all of its reads before the next render request would be processed. Overall this will lead to a more consistant performance profile for render requests.
woodsaj committedNov 21, 2017 Configuration menu - View commit details
-
Copy full SHA for c8207b2 - Browse repository at this point
Copy the full SHA c8207b2View commit details -
dont pass a cancelFunc to getTargetsRemote/Local
woodsaj committedNov 21, 2017 Configuration menu - View commit details
-
Copy full SHA for b4c0648 - Browse repository at this point
Copy the full SHA b4c0648View commit details -
cancel context when peer queries fail for metricsIndex and metricsDelete
woodsaj committedNov 21, 2017 Configuration menu - View commit details
-
Copy full SHA for f5a5988 - Browse repository at this point
Copy the full SHA f5a5988View commit details -
more consistant conetxt.WithCancel logic
- the functions that spawn background work in new goroutines should be responsible for signalling to them that they should shutdown. So these functions should create a context.WithCancel and call cancel when the the first error is encounted.
woodsaj committedNov 21, 2017 Configuration menu - View commit details
-
Copy full SHA for d763539 - Browse repository at this point
Copy the full SHA d763539View commit details -
check if context is canceled before searching idx
woodsaj committedNov 21, 2017 Configuration menu - View commit details
-
Copy full SHA for e87b6a1 - Browse repository at this point
Copy the full SHA e87b6a1View commit details
Commits on Nov 22, 2017
-
use contexts correctly in tag methods
woodsaj committedNov 22, 2017 Configuration menu - View commit details
-
Copy full SHA for e08a3ca - Browse repository at this point
Copy the full SHA e08a3caView commit details
Commits on Dec 1, 2017
-
pass errors instead of panicing in data fetch pipeline
- Instead of calling panic and having to recover the panic later, just pass errors throught the data fetch (getTargets) pipeline. This allows us to correctly cancel requests via the request context.
woodsaj committedDec 1, 2017 Configuration menu - View commit details
-
Copy full SHA for 7d3e803 - Browse repository at this point
Copy the full SHA 7d3e803View commit details
Commits on Dec 4, 2017
-
Configuration menu - View commit details
-
Copy full SHA for 2e98a0d - Browse repository at this point
Copy the full SHA 2e98a0dView commit details -
* no need to wrap an if err clause around s.getSeriesFixed(), as the output is always correct (in particular, when it returns an error, the series is nil) * add consolidation.ConsolidateContext() wrapper so that the caller doesn't need to check the context prior to a call to consolidation.Consolidate() * ditto for divideContext() -> divide() * ditto for getSeriesFixed, except it doesn't need a wrapper, it was already checking the ctx.Done for most of its work (but not all)
Configuration menu - View commit details
-
Copy full SHA for 04b955e - Browse repository at this point
Copy the full SHA 04b955eView commit details -
Configuration menu - View commit details
-
Copy full SHA for e8eefaf - Browse repository at this point
Copy the full SHA e8eefafView commit details
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.