Use a separate DB connection pool and execution context for task rebuilding#1252
Draft
jake-low wants to merge 1 commit into
Draft
Use a separate DB connection pool and execution context for task rebuilding#1252jake-low wants to merge 1 commit into
jake-low wants to merge 1 commit into
Conversation
|
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.



As discussed in Slack. This introduces a new DB connection pool called
background, and a new thread pool / execution context calledtask-builder-dispatcherwhich are used for building (or rebuilding) challenge tasks. The separate DB pool means that the default pool won't be exhausted so requests can still be served, and the separate thread pool means that if a burst of rebuilds are requested at once, only a fixed number will be allowed to progress (equal to the pool size) and the rest will queue up rather than entering a fail-and-retry loop.This should hopefully help alleviate the issue we've been seeing where API requests time out periodically during times when some user is requesting a whole bunch of challenges be rebuilt in a short burst.