HttpRemoteTaskRunnerV2#18729
Closed
jtuglu1 wants to merge 1 commit into
Closed
Conversation
jtuglu1
force-pushed
the
http-remote-task-runner-revamp
branch
5 times, most recently
from
November 11, 2025 03:13
b55b58f to
6638117
Compare
Contributor
Author
|
@kfaraz any thoughts here? |
Contributor
Author
|
@gianm @clintropolis could I get your thoughts here? |
jtuglu1
force-pushed
the
http-remote-task-runner-revamp
branch
from
December 13, 2025 00:35
6638117 to
00e4680
Compare
jtuglu1
force-pushed
the
http-remote-task-runner-revamp
branch
from
December 13, 2025 02:09
00e4680 to
1fd6e97
Compare
Contributor
Author
|
Bumping this @kfaraz 🙃. |
jtuglu1
commented
Dec 16, 2025
|
|
||
| final String workerHost = workerToAssign.getWorker().getHost(); | ||
| try { | ||
| if (!runTaskOnWorker(taskId, workerHost)) { |
Contributor
Author
There was a problem hiding this comment.
A quick note: @kfaraz I was tempted to place this inside the above .compute() to avoid the race, but given it could be holding the lock for a while (and concurrent hashmap locks a range of keys, not necessarily just the key), I opted to unlock (similar to what the existing runner does). Additionally, if something like a removeWorker callback occurs, I'd prefer to update the state right away, rather than wait for an assignment timeout, etc.
10 tasks
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.
Description
Still a draft.
I've seen on the giant lock in
HttpRemoteTaskRunnercause severe performance degradation under heavy load(200-500ms per acquisition with 1000s of activeTasks can slow down the startPendingTasks loop in TaskQueue). This leads to scheduling delays, which leads to more lag, which auto-scales more tasks, ..., etc. The runner also has a few (un)documented races abundant in the code. This overhead also slows down query tasks under load (e.g. MSQE and others) which utilize the scheduler for execution.I'm attempting a rewrite of this class to optimize for throughput and safety.
Apart from the performance improvements/bug fixes, this will also include some new features:
I would ultimately like to make this the default
HttpRemoteTaskRunnerand have it run in all tests/production clusters, etc. as I think that would help catch more bugs/issues.Performance Testing
Test results thus far have shown ~100-300ms speed up per task runner operation (
add(), etc.). Over 1000s of tasks, this amounts to minutes of delay saved.Release note
Key changed/added classes in this PR
MyFooOurBarTheirBazThis PR has: