Skip to content

Commit

Permalink
Remove synchronization for onTriggered method
Browse files Browse the repository at this point in the history
Parallel triggering of multiple jobs for the same event should not
produce any issues as there is synchronization in onStarted method as
well.

But in same time onTriggered also is part of initial event processing.
That's why it's important to not have a lock here.
  • Loading branch information
Jimilian committed May 18, 2018
1 parent d50f135 commit 37b2b42
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,18 +332,13 @@ protected void cleanUpGerritCauses(GerritCause firstFound, Run build) {
* @param project the project that will be built.
* @param event the event that caused the build to be scheduled.
*/
public synchronized void onTriggered(Job project, GerritTriggeredEvent event) {
public void onTriggered(Job project, GerritTriggeredEvent event) {
//TODO stop builds for earlier patch-sets on same change.
memory.triggered(event, project);
if (event instanceof GerritEventLifecycle) {
((GerritEventLifecycle)event).fireProjectTriggered(project);
}
//Logging
String name = null;
if (project != null) {
name = project.getName();
}
logger.info("Project [{}] triggered by Gerrit: [{}]", name, event);
logger.info("Project [{}] triggered by Gerrit: [{}]", project.getName(), event);
}

/**
Expand Down

0 comments on commit 37b2b42

Please sign in to comment.