Skip to content

Commit b190fe8

Browse files
NikhilCollooruarhimondr
authored andcommitted
Remove synchronization for updateFinalTaskInfo()
During lock profiling we observed that there is some contention when calling SqlStageExecution.updateFinalTaskInfo(). runningTasks used inside this method is a thread safe hashset. Also the stateMachine.setAllTasksFinal() is thread safe, as it acquires locks before execution. So its safe to remvoe the "synchronized" for updateFinalTaskInfo().
1 parent 99ea15b commit b190fe8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

presto-main/src/main/java/com/facebook/presto/execution/SqlStageExecution.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -718,13 +718,13 @@ private boolean isRecoverable(List<ExecutionFailureInfo> failures)
718718
failedTasks.size() < allTasks.size() * maxFailedTaskPercentage;
719719
}
720720

721-
private synchronized void updateFinalTaskInfo(TaskInfo finalTaskInfo)
721+
private void updateFinalTaskInfo(TaskInfo finalTaskInfo)
722722
{
723723
runningTasks.remove(finalTaskInfo.getTaskId());
724724
checkAllTaskFinal();
725725
}
726726

727-
private synchronized void checkAllTaskFinal()
727+
private void checkAllTaskFinal()
728728
{
729729
if (stateMachine.getState().isDone() && runningTasks.isEmpty()) {
730730
if (getFragment().getStageExecutionDescriptor().isStageGroupedExecution()) {

0 commit comments

Comments
 (0)