From 2ad8c7029dfbf9362be1cb57dc4be2c66fbb5c99 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 8 Oct 2018 13:51:08 -0400 Subject: [PATCH 01/10] [JENKINS-26521] Prove that Channel.export is needed for JEP-210 compatibility. --- pom.xml | 25 +++++++++++++------ .../workflow/steps/TimeoutStepTest.java | 20 +++++++++++++++ 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 046b8250..39707d70 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ org.jenkins-ci.plugins plugin - 3.19 + 3.25 org.jenkins-ci.plugins.workflow @@ -67,9 +67,9 @@ 2.121.1 8 2.15 - 2.32 - 2.14 - 2.28 + 2.58-beta-1 + 2.21-beta-1 + 2.30-beta-1 true @@ -98,7 +98,7 @@ org.jenkins-ci.plugins structs - 1.14 + 1.17 org.jenkins-ci.plugins @@ -121,13 +121,13 @@ org.jenkins-ci.plugins.workflow workflow-job - 2.10 + 2.26-beta-1 test org.jenkins-ci.plugins.workflow workflow-durable-task-step - 2.3 + 2.22-rc713.c51e25cf0eef test @@ -182,7 +182,7 @@ org.jenkins-ci.plugins script-security - 1.28 + 1.46 test @@ -205,4 +205,13 @@ test + + + + org.jenkins-ci.plugins + scm-api + 2.2.6 + + + diff --git a/src/test/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepTest.java b/src/test/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepTest.java index 92af2dc0..f3952860 100644 --- a/src/test/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepTest.java +++ b/src/test/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepTest.java @@ -24,6 +24,7 @@ package org.jenkinsci.plugins.workflow.steps; +import hudson.Functions; import hudson.model.Result; import hudson.model.TaskListener; import hudson.model.listeners.RunListener; @@ -43,6 +44,7 @@ import org.jenkinsci.plugins.workflow.test.steps.SemaphoreStep; import org.junit.*; import static org.junit.Assert.assertEquals; +import static org.junit.Assume.*; import org.junit.runners.model.Statement; import org.jvnet.hudson.test.BuildWatcher; import org.jvnet.hudson.test.Issue; @@ -239,6 +241,24 @@ public void evaluate() throws Throwable { }); } + @Test + public void activityRemote() { + assumeFalse(Functions.isWindows()); // TODO create analogue using bat + story.then(r -> { + r.createSlave(); + WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p"); + p.setDefinition(new CpsFlowDefinition("" + + "node('!master') {\n" + + " timeout(time:5, unit:'SECONDS', activity: true) {\n" + + " sh 'set +x; echo NotHere; sleep 3; echo NotHereYet; sleep 3; echo JustHere; sleep 10; echo ShouldNot'\n" + + " }\n" + + "}\n", true)); + WorkflowRun b = r.assertBuildStatus(Result.ABORTED, p.scheduleBuild2(0)); + story.j.assertLogContains("JustHere", b); + story.j.assertLogNotContains("ShouldNot", b); + }); + } + @Issue("JENKINS-26163") @Test public void restarted() throws Exception { From 11c9999989a623095babb2c77ff7025d7e69c028 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 9 Oct 2018 10:27:41 -0400 Subject: [PATCH 02/10] Updated test to match change in logging format. --- .../org/jenkinsci/plugins/workflow/steps/EnvStepTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/jenkinsci/plugins/workflow/steps/EnvStepTest.java b/src/test/java/org/jenkinsci/plugins/workflow/steps/EnvStepTest.java index 959ef530..6512733b 100644 --- a/src/test/java/org/jenkinsci/plugins/workflow/steps/EnvStepTest.java +++ b/src/test/java/org/jenkinsci/plugins/workflow/steps/EnvStepTest.java @@ -90,9 +90,9 @@ public class EnvStepTest { WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p"); p.setDefinition(new CpsFlowDefinition( "parallel a: {\n" + - " node {withEnv(['TOOL=aloc']) {semaphore 'a'; isUnix() ? sh('echo TOOL=$TOOL') : bat('echo TOOL=%TOOL%')}}\n" + + " node {withEnv(['TOOL=aloc']) {semaphore 'a'; isUnix() ? sh('echo a TOOL=$TOOL') : bat('echo a TOOL=%TOOL%')}}\n" + "}, b: {\n" + - " node {withEnv(['TOOL=bloc']) {semaphore 'b'; isUnix() ? sh('echo TOOL=$TOOL') : bat('echo TOOL=%TOOL%')}}\n" + + " node {withEnv(['TOOL=bloc']) {semaphore 'b'; isUnix() ? sh('echo b TOOL=$TOOL') : bat('echo b TOOL=%TOOL%')}}\n" + "}", true)); WorkflowRun b = p.scheduleBuild2(0).getStartCondition().get(); SemaphoreStep.waitForStart("a/1", b); @@ -100,8 +100,8 @@ public class EnvStepTest { SemaphoreStep.success("a/1", null); SemaphoreStep.success("b/1", null); story.j.assertBuildStatusSuccess(story.j.waitForCompletion(b)); - story.j.assertLogContains("[a] TOOL=aloc", b); - story.j.assertLogContains("[b] TOOL=bloc", b); + story.j.assertLogContains("a TOOL=aloc", b); + story.j.assertLogContains("b TOOL=bloc", b); } }); } From 746f4555821c7632f56d020e3e9daa123da97f5d Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 16 Oct 2018 12:38:52 -0400 Subject: [PATCH 03/10] [JENKINS-54078] Reproduced error in test. --- pom.xml | 24 ++++++++++++++++++- .../workflow/steps/TimeoutStepTest.java | 22 +++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 39707d70..1ff9e8eb 100644 --- a/pom.xml +++ b/pom.xml @@ -71,6 +71,8 @@ 2.21-beta-1 2.30-beta-1 true + 4.0.0-beta3 + 2.2.6 @@ -204,13 +206,33 @@ tests test + + org.jenkins-ci.plugins + git + ${git-plugin.version} + test + + + org.jenkins-ci.plugins + scm-api + ${scm-api-plugin.version} + tests + test + + + org.jenkins-ci.plugins + git + ${git-plugin.version} + tests + test + org.jenkins-ci.plugins scm-api - 2.2.6 + ${scm-api-plugin.version} diff --git a/src/test/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepTest.java b/src/test/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepTest.java index f3952860..32966701 100644 --- a/src/test/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepTest.java +++ b/src/test/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepTest.java @@ -34,6 +34,7 @@ import java.util.concurrent.TimeUnit; import jenkins.model.CauseOfInterruption; import jenkins.model.InterruptedBuildAction; +import jenkins.plugins.git.GitSampleRepoRule; import org.jenkinsci.plugins.workflow.actions.ErrorAction; import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition; import org.jenkinsci.plugins.workflow.cps.nodes.StepAtomNode; @@ -59,6 +60,8 @@ public class TimeoutStepTest extends Assert { @Rule public RestartableJenkinsRule story = new RestartableJenkinsRule(); + @Rule public GitSampleRepoRule git = new GitSampleRepoRule(); + @Test public void configRoundTrip() { story.addStep(new Statement() { @Override public void evaluate() throws Throwable { @@ -259,6 +262,25 @@ public void activityRemote() { }); } + @Ignore("TODO") + @Issue("JENKINS-54078") + @Test public void activityGit() { + story.then(r -> { + r.createSlave(); + git.init(); + git.write("file", "content"); + git.git("commit", "--all", "--message=init"); + WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p"); + p.setDefinition(new CpsFlowDefinition("" + + "node('!master') {\n" + + " timeout(time: 5, unit: 'MINUTES', activity: true) {\n" + + " git($/" + git + "/$)\n" + + " }\n" + + "}\n", true)); + r.buildAndAssertSuccess(p); + }); + } + @Issue("JENKINS-26163") @Test public void restarted() throws Exception { From f66bb29b2069edff752b1b852c05534fd9083ada Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 16 Oct 2018 12:41:55 -0400 Subject: [PATCH 04/10] May as well use nonbeta versions of JEP-210 plugins. --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 1ff9e8eb..e79c4e6b 100644 --- a/pom.xml +++ b/pom.xml @@ -67,9 +67,9 @@ 2.121.1 8 2.15 - 2.58-beta-1 - 2.21-beta-1 - 2.30-beta-1 + 2.58 + 2.21 + 2.30 true 4.0.0-beta3 2.2.6 @@ -123,7 +123,7 @@ org.jenkins-ci.plugins.workflow workflow-job - 2.26-beta-1 + 2.26 test From 128f7d2f08631683fe61ed0cb19db141b7dfc43d Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 16 Oct 2018 13:11:39 -0400 Subject: [PATCH 05/10] [JENKINS-54078] Do not rely on Channel.export as we have little control over when the ref is collected. --- .../workflow/steps/TimeoutStepExecution.java | 54 ++++++++++++++----- .../workflow/steps/TimeoutStepTest.java | 1 - 2 files changed, 40 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java b/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java index 20f2f210..05d9b0bb 100644 --- a/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java +++ b/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java @@ -10,17 +10,22 @@ import hudson.model.Result; import hudson.model.Run; import hudson.model.TaskListener; +import hudson.remoting.Callable; import hudson.remoting.Channel; import java.io.IOException; import java.io.OutputStream; import java.io.Serializable; import java.util.List; +import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; +import javax.annotation.CheckForNull; +import javax.annotation.Nonnull; import jenkins.model.CauseOfInterruption; +import jenkins.security.SlaveToMasterCallable; import jenkins.util.Timer; import org.jenkinsci.plugins.workflow.flow.FlowExecution; import org.jenkinsci.plugins.workflow.graph.FlowNode; @@ -46,10 +51,14 @@ public class TimeoutStepExecution extends AbstractStepExecutionImpl { /** whether we are forcing the body to end */ private boolean forcible; + /** Token for {@link #activity} callbacks. */ + private final String id; + TimeoutStepExecution(TimeoutStep step, StepContext context) { super(context); this.step = step; this.activity = step.isActivity(); + id = activity ? UUID.randomUUID().toString() : null; } @Override @@ -62,7 +71,7 @@ public boolean start() throws Exception { bodyInvoker = bodyInvoker.withContext( BodyInvoker.mergeConsoleLogFilters( context.get(ConsoleLogFilter.class), - new ConsoleLogFilterImpl(new ResetCallbackImpl()) + new ConsoleLogFilterImpl(id) ) ); } @@ -230,29 +239,41 @@ public String getShortDescription() { } } - public interface ResetCallback extends Serializable { - void logWritten(); - } + private static final class ResetTimer extends SlaveToMasterCallable { - private class ResetCallbackImpl implements ResetCallback { private static final long serialVersionUID = 1L; - @Override public void logWritten() { - resetTimer(); + + private final String id; + + ResetTimer(String id) { + this.id = id; } + + @Override public Void call() throws RuntimeException { + StepExecution.applyAll(TimeoutStepExecution.class, e -> { + if (id.equals(e.id)) { + e.resetTimer(); + } + return null; + }); + return null; + } + } private static class ConsoleLogFilterImpl extends ConsoleLogFilter implements /* TODO Remotable */ Serializable { private static final long serialVersionUID = 1L; - private final ResetCallback callback; + private final @Nonnull String id; + private transient @CheckForNull Channel channel; - ConsoleLogFilterImpl(ResetCallback callback) { - this.callback = callback; + ConsoleLogFilterImpl(String id) { + this.id = id; } - private Object writeReplace() { - Channel ch = Channel.current(); - return ch == null ? this : new ConsoleLogFilterImpl(ch.export(ResetCallback.class, callback)); + private Object readResolve() { + channel = Channel.current(); + return this; } @Override @@ -262,7 +283,12 @@ public OutputStream decorateLogger(@SuppressWarnings("rawtypes") Run build, fina @Override protected void eol(byte[] b, int len) throws IOException { logger.write(b, 0, len); - callback.logWritten(); + Callable resetTimer = new ResetTimer(id); + if (channel != null) { + channel.callAsync(resetTimer); + } else { + resetTimer.call(); + } } @Override diff --git a/src/test/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepTest.java b/src/test/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepTest.java index 32966701..f8ac74a1 100644 --- a/src/test/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepTest.java +++ b/src/test/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepTest.java @@ -262,7 +262,6 @@ public void activityRemote() { }); } - @Ignore("TODO") @Issue("JENKINS-54078") @Test public void activityGit() { story.then(r -> { From 5d8c46413bd360a7c204217ca519ef82145c50eb Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 23 Oct 2018 14:05:25 -0400 Subject: [PATCH 06/10] https://github.com/jenkinsci/workflow-durable-task-step-plugin/pull/75 was released. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e79c4e6b..4b400f20 100644 --- a/pom.xml +++ b/pom.xml @@ -129,7 +129,7 @@ org.jenkins-ci.plugins.workflow workflow-durable-task-step - 2.22-rc713.c51e25cf0eef + 2.24 test From 091891822a826871da1451a6b552a54dc15f1733 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 23 Oct 2018 14:15:59 -0400 Subject: [PATCH 07/10] Handle deserialization of old ConsoleLogFilterImpl with null id. --- .../plugins/workflow/steps/TimeoutStepExecution.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java b/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java index 05d9b0bb..542353a1 100644 --- a/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java +++ b/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java @@ -23,7 +23,6 @@ import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.CheckForNull; -import javax.annotation.Nonnull; import jenkins.model.CauseOfInterruption; import jenkins.security.SlaveToMasterCallable; import jenkins.util.Timer; @@ -243,7 +242,8 @@ private static final class ResetTimer extends SlaveToMasterCallable { - if (id.equals(e.id)) { + if (id == null || id.equals(e.id)) { e.resetTimer(); } return null; @@ -264,7 +264,7 @@ private static final class ResetTimer extends SlaveToMasterCallable Date: Thu, 25 Oct 2018 09:51:42 -0400 Subject: [PATCH 08/10] Minimize the number of ResetTimer calls made. --- .../workflow/steps/TimeoutStepExecution.java | 73 +++++++++++++++---- 1 file changed, 59 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java b/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java index 542353a1..f279e06d 100644 --- a/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java +++ b/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java @@ -15,14 +15,18 @@ import java.io.IOException; import java.io.OutputStream; import java.io.Serializable; +import java.lang.ref.Reference; +import java.lang.ref.WeakReference; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.CheckForNull; +import javax.annotation.Nonnull; import jenkins.model.CauseOfInterruption; import jenkins.security.SlaveToMasterCallable; import jenkins.util.Timer; @@ -41,7 +45,7 @@ public class TimeoutStepExecution extends AbstractStepExecutionImpl { private BodyExecution body; private transient ScheduledFuture killer; - private long timeout = 0; + private final long timeout; private long end = 0; /** Used to track whether this is timing out on inactivity without needing to reference {@link #step}. */ @@ -58,6 +62,7 @@ public class TimeoutStepExecution extends AbstractStepExecutionImpl { this.step = step; this.activity = step.isActivity(); id = activity ? UUID.randomUUID().toString() : null; + timeout = step.getUnit().toMillis(step.getTime()); } @Override @@ -70,13 +75,12 @@ public boolean start() throws Exception { bodyInvoker = bodyInvoker.withContext( BodyInvoker.mergeConsoleLogFilters( context.get(ConsoleLogFilter.class), - new ConsoleLogFilterImpl(id) + new ConsoleLogFilterImpl(id, timeout) ) ); } body = bodyInvoker.start(); - timeout = step.getUnit().toMillis(step.getTime()); resetTimer(); return false; // execution is asynchronous } @@ -242,8 +246,7 @@ private static final class ResetTimer extends SlaveToMasterCallable { - if (id == null || id.equals(e.id)) { + if (id.equals(e.id)) { e.resetTimer(); } return null; @@ -265,10 +268,12 @@ private static class ConsoleLogFilterImpl extends ConsoleLogFilter implements /* private static final long serialVersionUID = 1L; private final @CheckForNull String id; + private final long timeout; private transient @CheckForNull Channel channel; - ConsoleLogFilterImpl(String id) { + ConsoleLogFilterImpl(String id, long timeout) { this.id = id; + this.timeout = timeout; } private Object readResolve() { @@ -279,16 +284,15 @@ private Object readResolve() { @Override public OutputStream decorateLogger(@SuppressWarnings("rawtypes") Run build, final OutputStream logger) throws IOException, InterruptedException { - return new LineTransformationOutputStream() { + if (id == null) { + return logger; // TODO restore compatibility + } + AtomicBoolean active = new AtomicBoolean(); + OutputStream decorated = new LineTransformationOutputStream() { @Override protected void eol(byte[] b, int len) throws IOException { logger.write(b, 0, len); - Callable resetTimer = new ResetTimer(id); - if (channel != null) { - channel.callAsync(resetTimer); - } else { - resetTimer.call(); - } + active.set(true); } @Override @@ -303,6 +307,47 @@ public void close() throws IOException { logger.close(); } }; + long period = timeout / 2; // less than the full timeout, to give some grace period, but in the same ballpark to avoid overhead + new Tick(active, new WeakReference<>(decorated), period, channel, id).schedule(); + return decorated; + } + } + + private static final class Tick implements Runnable { + private final AtomicBoolean active; + private final Reference stream; + private final long period; + private final @CheckForNull Channel channel; + private final @Nonnull String id; + Tick(AtomicBoolean active, Reference stream, long period, Channel channel, String id) { + this.active = active; + this.stream = stream; + this.period = period; + this.channel = channel; + this.id = id; + } + @Override + public void run() { + if (stream.get() == null) { + // Not only idle but gone—stop the timer. + return; + } + if (active.getAndSet(false)) { + Callable resetTimer = new ResetTimer(id); + if (channel != null) { + try { + channel.call(resetTimer); + } catch (Exception x) { + LOGGER.log(Level.WARNING, null, x); + } + } else { + resetTimer.call(); + } + } + schedule(); + } + void schedule() { + Timer.get().schedule(this, period, TimeUnit.MILLISECONDS); } } From 3af06c9e85cfdd93590e46d1074227c7415d72e2 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 25 Oct 2018 11:17:46 -0400 Subject: [PATCH 09/10] If the Tick sees an idle stream, reschedule sooner to avoid a false timeout. --- .../workflow/steps/TimeoutStepExecution.java | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java b/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java index f279e06d..1945d6cc 100644 --- a/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java +++ b/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java @@ -287,6 +287,7 @@ public OutputStream decorateLogger(@SuppressWarnings("rawtypes") Run build, fina if (id == null) { return logger; // TODO restore compatibility } + // TODO if channel == null, we can safely ResetTimer.call synchronously from eol and skip the Tick AtomicBoolean active = new AtomicBoolean(); OutputStream decorated = new LineTransformationOutputStream() { @Override @@ -307,8 +308,7 @@ public void close() throws IOException { logger.close(); } }; - long period = timeout / 2; // less than the full timeout, to give some grace period, but in the same ballpark to avoid overhead - new Tick(active, new WeakReference<>(decorated), period, channel, id).schedule(); + new Tick(active, new WeakReference<>(decorated), timeout, channel, id).schedule(); return decorated; } } @@ -316,13 +316,13 @@ public void close() throws IOException { private static final class Tick implements Runnable { private final AtomicBoolean active; private final Reference stream; - private final long period; + private final long timeout; private final @CheckForNull Channel channel; private final @Nonnull String id; - Tick(AtomicBoolean active, Reference stream, long period, Channel channel, String id) { + Tick(AtomicBoolean active, Reference stream, long timeout, Channel channel, String id) { this.active = active; this.stream = stream; - this.period = period; + this.timeout = timeout; this.channel = channel; this.id = id; } @@ -332,7 +332,8 @@ public void run() { // Not only idle but gone—stop the timer. return; } - if (active.getAndSet(false)) { + boolean currentlyActive = active.getAndSet(false); + if (currentlyActive) { Callable resetTimer = new ResetTimer(id); if (channel != null) { try { @@ -343,11 +344,17 @@ public void run() { } else { resetTimer.call(); } + schedule(); + } else { + // Idle at the moment, but check well before the timeout expires in case new output appears. + schedule(timeout / 10); } - schedule(); } void schedule() { - Timer.get().schedule(this, period, TimeUnit.MILLISECONDS); + schedule(timeout / 2); // less than the full timeout, to give some grace period, but in the same ballpark to avoid overhead + } + private void schedule(long delay) { + Timer.get().schedule(this, delay, TimeUnit.MILLISECONDS); } } From 066e961f26c24543af5dd573d8c982dddd1369a6 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 25 Oct 2018 13:44:10 -0400 Subject: [PATCH 10/10] Retain the original ConsoleLogFilterImpl for derialization, but do not use it for new builds. --- .../workflow/steps/TimeoutStepExecution.java | 67 +++++++++++++++++-- 1 file changed, 60 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java b/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java index 1945d6cc..e8fd3bb4 100644 --- a/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java +++ b/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java @@ -75,7 +75,7 @@ public boolean start() throws Exception { bodyInvoker = bodyInvoker.withContext( BodyInvoker.mergeConsoleLogFilters( context.get(ConsoleLogFilter.class), - new ConsoleLogFilterImpl(id, timeout) + new ConsoleLogFilterImpl2(id, timeout) ) ); } @@ -264,14 +264,14 @@ private static final class ResetTimer extends SlaveToMasterCallable