Skip to content

Commit

Permalink
Merge pull request #2043 from ydubreuil/fix-futureimpl
Browse files Browse the repository at this point in the history
[FIXED JENKINS-33038] correctly set executor in FutureImpl
  • Loading branch information
olivergondza committed Mar 16, 2016
2 parents b653dc2 + 8d3eb20 commit eeea5ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 3 additions & 0 deletions core/src/main/java/hudson/model/queue/WorkUnit.java
Expand Up @@ -71,6 +71,9 @@ public final class WorkUnit {

public void setExecutor(@CheckForNull Executor e) {
executor = e;
if (e != null) {
context.future.addExecutor(e);
}
}

/**
Expand Down
7 changes: 1 addition & 6 deletions core/src/main/java/hudson/model/queue/WorkUnitContext.java
Expand Up @@ -88,14 +88,9 @@ protected void onCriteriaMet() {
}

/**
* Called by the executor that executes a member {@link SubTask} that belongs to this task
* to create its {@link WorkUnit}.
* Called within the queue maintenance process to create a {@link WorkUnit} for the given {@link SubTask}
*/
public WorkUnit createWorkUnit(SubTask execUnit) {
Executor executor = Executor.currentExecutor();
if (executor != null) { // TODO is it legal for this to be called by a non-executor thread?
future.addExecutor(executor);
}
WorkUnit wu = new WorkUnit(this, execUnit);
workUnits.add(wu);
return wu;
Expand Down

0 comments on commit eeea5ee

Please sign in to comment.