Reduce contention in HttpRemoteTaskRunner.getKnownTasks() (#14541)

This commit is contained in:
Kashif Faraz 2023-07-07 13:43:59 +05:30 committed by GitHub
parent dd78e00dc5
commit d63eff3b1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -1431,11 +1431,10 @@ public class HttpRemoteTaskRunner implements WorkerTaskRunner, TaskLogStreamer
}
@Override
@SuppressWarnings("GuardedBy") // Read on tasks is safe
public Collection<? extends TaskRunnerWorkItem> getKnownTasks()
{
synchronized (statusLock) {
return ImmutableList.copyOf(tasks.values());
}
return ImmutableList.copyOf(tasks.values());
}
@SuppressWarnings("GuardedBy") // Read on tasks is safe