Skip to content

Use a separate DB connection pool and execution context for task rebuilding#1252

Open
jake-low wants to merge 3 commits into
mainfrom
jlow/separate-task-build-pools
Open

Use a separate DB connection pool and execution context for task rebuilding#1252
jake-low wants to merge 3 commits into
mainfrom
jlow/separate-task-build-pools

Conversation

@jake-low

@jake-low jake-low commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

As discussed in Slack. This introduces a new DB connection pool called background, and a new thread pool / execution context called task-builder-dispatcher which 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.

@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

@jake-low

jake-low commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

I figured out how to fix the tests, and verified that it's working locally (creating and then rebuilding a challenge from the mr3 UI and confirming that the /rebuild endpoint still works). This is ready for review now.

@jake-low jake-low marked this pull request as ready for review July 8, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant