Skip to content

Commit

Permalink
[JENKINS-44747] Limit the amount of time categoriesForPipeline can run.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Jun 7, 2017
1 parent 7c61f61 commit a4cb745
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion pom.xml
Expand Up @@ -176,7 +176,6 @@ THE SOFTWARE.
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-support</artifactId>
<version>2.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
Expand Down
Expand Up @@ -27,6 +27,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.CheckForNull;
Expand All @@ -42,6 +43,7 @@
import org.jenkinsci.plugins.workflow.graph.StepNode;
import org.jenkinsci.plugins.workflow.graphanalysis.LinearBlockHoppingScanner;
import org.jenkinsci.plugins.workflow.steps.StepDescriptor;
import org.jenkinsci.plugins.workflow.support.concurrent.Timeout;
import org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution.PlaceholderTask;

@Extension
Expand Down Expand Up @@ -407,7 +409,7 @@ public List<ParameterValue> getParametersFromQueueItem(Queue.Item item) {
private List<String> categoriesForPipeline(Task task) {
if (task instanceof PlaceholderTask) {
PlaceholderTask placeholderTask = (PlaceholderTask)task;
try {
try (Timeout t = Timeout.limit(100, TimeUnit.MILLISECONDS)) {
FlowNode firstThrottle = firstThrottleStartNode(placeholderTask.getNode());
Run<?,?> r = placeholderTask.run();
if (firstThrottle != null && r != null) {
Expand Down

0 comments on commit a4cb745

Please sign in to comment.