Interrupt build with meaningful message when slave disconnected from UI. Current implementation fail the build with:

      FATAL: hudson.remoting.Channel$OrderlyShutdown
      hudson.remoting.RequestAbortedException: hudson.remoting.Channel$OrderlyShutdown
      	at hudson.remoting.Request.abort(Request.java:295)
      	at hudson.remoting.Channel.terminate(Channel.java:814)
      	at hudson.remoting.Channel$CloseCommand.execute(Channel.java:1029)
      	at hudson.remoting.Channel$2.handle(Channel.java:483)
      	at hudson.remoting.AbstractByteArrayCommandTransport$1.handle(AbstractByteArrayCommandTransport.java:61)
      	at org.jenkinsci.remoting.nio.NioChannelHub$2.run(NioChannelHub.java:597)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:111)
      	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      	at ......remote call to jnlp(Native Method)
      	at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1356)
      	at hudson.remoting.Request.call(Request.java:171)
      	at hudson.remoting.Channel.call(Channel.java:751)
      	at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:173)
      	at com.sun.proxy.$Proxy47.join(Unknown Source)
      	at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:979)
      	at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:137)
      	at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:97)
      	at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
      	at hudson.model.Build$BuildExecution.build(Build.java:199)
      	at hudson.model.Build$BuildExecution.doRun(Build.java:160)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533)
      	at hudson.model.Run.execute(Run.java:1745)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:89)
      	at hudson.model.Executor.run(Executor.java:240)
      Caused by: hudson.remoting.Channel$OrderlyShutdown
      	at hudson.remoting.Channel$CloseCommand.execute(Channel.java:1029)
      	at hudson.remoting.Channel$2.handle(Channel.java:483)
      	at hudson.remoting.AbstractByteArrayCommandTransport$1.handle(AbstractByteArrayCommandTransport.java:61)
      	at org.jenkinsci.remoting.nio.NioChannelHub$2.run(NioChannelHub.java:597)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:111)
      	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: Command close created at
      	at hudson.remoting.Command.<init>(Command.java:56)
      	at hudson.remoting.Channel$CloseCommand.<init>(Channel.java:1023)
      	at hudson.remoting.Channel$CloseCommand.<init>(Channel.java:1021)
      	at hudson.remoting.Channel.close(Channel.java:1104)
      	at hudson.remoting.Channel.close(Channel.java:1087)
      	at hudson.remoting.Channel$CloseCommand.execute(Channel.java:1028)
      	at hudson.remoting.Channel$2.handle(Channel.java:483)
      	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:60)
      

          [JENKINS-26411] Improve error reporting when channel closed

          Oliver Gondža added a comment - https://github.com/jenkinsci/jenkins/pull/1529

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          core/src/main/java/hudson/model/AbstractBuild.java
          test/src/test/groovy/hudson/model/AbstractBuildTest.groovy
          test/src/test/java/hudson/model/ExecutorTest.java
          http://jenkins-ci.org/commit/jenkins/f61f2cd3caffcb97bc1d3d681a4110690df97b5d
          Log:
          JENKINS-26411 Do not interrupt build abruptly when exception is thrown from build step

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: core/src/main/java/hudson/model/AbstractBuild.java test/src/test/groovy/hudson/model/AbstractBuildTest.groovy test/src/test/java/hudson/model/ExecutorTest.java http://jenkins-ci.org/commit/jenkins/f61f2cd3caffcb97bc1d3d681a4110690df97b5d Log: JENKINS-26411 Do not interrupt build abruptly when exception is thrown from build step

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          core/src/main/java/hudson/model/AbstractBuild.java
          test/src/test/java/hudson/model/ExecutorTest.java
          http://jenkins-ci.org/commit/jenkins/788d6ff6e96b7880e555fff4768d1f968094b7ed
          Log:
          [FIXED JENKINS-26411] Improve error reporting when channel closed

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: core/src/main/java/hudson/model/AbstractBuild.java test/src/test/java/hudson/model/ExecutorTest.java http://jenkins-ci.org/commit/jenkins/788d6ff6e96b7880e555fff4768d1f968094b7ed Log: [FIXED JENKINS-26411] Improve error reporting when channel closed

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          core/src/main/java/hudson/model/AbstractBuild.java
          http://jenkins-ci.org/commit/jenkins/b0351d21e60ec9d8cb47238e48c4423288496990
          Log:
          JENKINS-26411 Bring slave log link back

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: core/src/main/java/hudson/model/AbstractBuild.java http://jenkins-ci.org/commit/jenkins/b0351d21e60ec9d8cb47238e48c4423288496990 Log: JENKINS-26411 Bring slave log link back

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          core/src/main/java/hudson/model/AbstractBuild.java
          test/src/test/java/hudson/model/ExecutorTest.java
          http://jenkins-ci.org/commit/jenkins/555e2d593fbb419d2fad7e9cfae5911daf3d30e3
          Log:
          JENKINS-26411 Handle ChannelClosedException as well

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: core/src/main/java/hudson/model/AbstractBuild.java test/src/test/java/hudson/model/ExecutorTest.java http://jenkins-ci.org/commit/jenkins/555e2d593fbb419d2fad7e9cfae5911daf3d30e3 Log: JENKINS-26411 Handle ChannelClosedException as well

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3931
          JENKINS-26411 Do not interrupt build abruptly when exception is thrown from build step (Revision f61f2cd3caffcb97bc1d3d681a4110690df97b5d)
          [FIXED JENKINS-26411] Improve error reporting when channel closed (Revision 788d6ff6e96b7880e555fff4768d1f968094b7ed)
          JENKINS-26411 Bring slave log link back (Revision b0351d21e60ec9d8cb47238e48c4423288496990)
          JENKINS-26411 Handle ChannelClosedException as well (Revision 555e2d593fbb419d2fad7e9cfae5911daf3d30e3)

          Result = SUCCESS
          ogondza : f61f2cd3caffcb97bc1d3d681a4110690df97b5d
          Files :

          • core/src/main/java/hudson/model/AbstractBuild.java
          • test/src/test/java/hudson/model/ExecutorTest.java
          • test/src/test/groovy/hudson/model/AbstractBuildTest.groovy

          ogondza : 788d6ff6e96b7880e555fff4768d1f968094b7ed
          Files :

          • test/src/test/java/hudson/model/ExecutorTest.java
          • core/src/main/java/hudson/model/AbstractBuild.java

          ogondza : b0351d21e60ec9d8cb47238e48c4423288496990
          Files :

          • core/src/main/java/hudson/model/AbstractBuild.java

          ogondza : 555e2d593fbb419d2fad7e9cfae5911daf3d30e3
          Files :

          • test/src/test/java/hudson/model/ExecutorTest.java
          • core/src/main/java/hudson/model/AbstractBuild.java

          dogfood added a comment - Integrated in jenkins_main_trunk #3931 JENKINS-26411 Do not interrupt build abruptly when exception is thrown from build step (Revision f61f2cd3caffcb97bc1d3d681a4110690df97b5d) [FIXED JENKINS-26411] Improve error reporting when channel closed (Revision 788d6ff6e96b7880e555fff4768d1f968094b7ed) JENKINS-26411 Bring slave log link back (Revision b0351d21e60ec9d8cb47238e48c4423288496990) JENKINS-26411 Handle ChannelClosedException as well (Revision 555e2d593fbb419d2fad7e9cfae5911daf3d30e3) Result = SUCCESS ogondza : f61f2cd3caffcb97bc1d3d681a4110690df97b5d Files : core/src/main/java/hudson/model/AbstractBuild.java test/src/test/java/hudson/model/ExecutorTest.java test/src/test/groovy/hudson/model/AbstractBuildTest.groovy ogondza : 788d6ff6e96b7880e555fff4768d1f968094b7ed Files : test/src/test/java/hudson/model/ExecutorTest.java core/src/main/java/hudson/model/AbstractBuild.java ogondza : b0351d21e60ec9d8cb47238e48c4423288496990 Files : core/src/main/java/hudson/model/AbstractBuild.java ogondza : 555e2d593fbb419d2fad7e9cfae5911daf3d30e3 Files : test/src/test/java/hudson/model/ExecutorTest.java core/src/main/java/hudson/model/AbstractBuild.java

          Xia Zhang added a comment - - edited

          I still reproduced this problem more than 10times within one month during jobs building.

          Jenkins version: Jenkins2.7.4
          Slave launched via JNLP
          Linux Kernel version: 3.10.0-327.el7.x86_64
          detail log:
          16:23:20 FATAL: hudson.remoting.Channel$OrderlyShutdown
          16:23:20 hudson.remoting.RequestAbortedException: hudson.remoting.Channel$OrderlyShutdown
          16:23:20 at hudson.remoting.Request.abort(Request.java:303)
          16:23:20 at hudson.remoting.Channel.terminate(Channel.java:847)
          16:23:20 at hudson.remoting.Channel$CloseCommand.execute(Channel.java:1080)
          16:23:20 at hudson.remoting.Channel$1.handle(Channel.java:501)
          16:23:20 at hudson.remoting.AbstractByteArrayCommandTransport$1.handle(AbstractByteArrayCommandTransport.java:61)
          16:23:20 at org.jenkinsci.remoting.nio.NioChannelHub$2.run(NioChannelHub.java:594)
          16:23:20 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
          16:23:20 at java.util.concurrent.FutureTask.run(FutureTask.java:262)
          16:23:20 at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
          16:23:20 at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
          16:23:20 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
          16:23:20 at java.util.concurrent.FutureTask.run(FutureTask.java:262)
          16:23:20 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          16:23:20 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          16:23:20 at java.lang.Thread.run(Thread.java:745)
          16:23:20 at ......remote call to mesos-jenkins-58207071568048808fbd9396283fe305-jenkins-slave-ru(Native Method)
          16:23:20 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416)
          16:23:20 at hudson.remoting.Request.call(Request.java:172)
          16:23:20 at hudson.remoting.Channel.call(Channel.java:780)
          16:23:20 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145)
          16:23:20 at sun.reflect.GeneratedMethodAccessor756.invoke(Unknown Source)
          16:23:20 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          16:23:20 at java.lang.reflect.Method.invoke(Method.java:606)
          16:23:20 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131)
          16:23:20 at com.sun.proxy.$Proxy88.execute(Unknown Source)
          16:23:20 at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1042)
          16:23:20 at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1082)
          16:23:20 at hudson.scm.SCM.checkout(SCM.java:495)
          16:23:20 at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
          16:23:20 at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
          16:23:20 at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
          16:23:20 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
          16:23:20 at hudson.model.Run.execute(Run.java:1741)
          16:23:20 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          16:23:20 at hudson.model.ResourceController.execute(ResourceController.java:98)
          16:23:20 at hudson.model.Executor.run(Executor.java:410)
          16:23:20 Caused by: hudson.remoting.Channel$OrderlyShutdown
          16:23:20 at hudson.remoting.Channel$CloseCommand.execute(Channel.java:1080)
          16:23:20 at hudson.remoting.Channel$1.handle(Channel.java:501)
          16:23:20 at hudson.remoting.AbstractByteArrayCommandTransport$1.handle(AbstractByteArrayCommandTransport.java:61)
          16:23:20 at org.jenkinsci.remoting.nio.NioChannelHub$2.run(NioChannelHub.java:594)
          16:23:20 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
          16:23:20 at java.util.concurrent.FutureTask.run(FutureTask.java:262)
          16:23:20 at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
          16:23:20 at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
          16:23:20 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
          16:23:20 at java.util.concurrent.FutureTask.run(FutureTask.java:262)
          16:23:20 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          16:23:20 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          16:23:20 at java.lang.Thread.run(Thread.java:745)
          16:23:20 Caused by: Command close created at
          16:23:20 at hudson.remoting.Command.<init>(Command.java:56)
          16:23:20 at hudson.remoting.Channel$CloseCommand.<init>(Channel.java:1074)
          16:23:20 at hudson.remoting.Channel$CloseCommand.<init>(Channel.java:1072)
          16:23:20 at hudson.remoting.Channel.close(Channel.java:1156)
          16:23:20 at hudson.remoting.Channel.close(Channel.java:1138)
          16:23:20 at hudson.remoting.Channel$CloseCommand.execute(Channel.java:1079)
          16:23:20 at hudson.remoting.Channel$1.handle(Channel.java:501)
          16:23:20 at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:83)

          Xia Zhang added a comment - - edited I still reproduced this problem more than 10times within one month during jobs building. Jenkins version: Jenkins2.7.4 Slave launched via JNLP Linux Kernel version: 3.10.0-327.el7.x86_64 detail log: 16:23:20 FATAL: hudson.remoting.Channel$OrderlyShutdown 16:23:20 hudson.remoting.RequestAbortedException: hudson.remoting.Channel$OrderlyShutdown 16:23:20 at hudson.remoting.Request.abort(Request.java:303) 16:23:20 at hudson.remoting.Channel.terminate(Channel.java:847) 16:23:20 at hudson.remoting.Channel$CloseCommand.execute(Channel.java:1080) 16:23:20 at hudson.remoting.Channel$1.handle(Channel.java:501) 16:23:20 at hudson.remoting.AbstractByteArrayCommandTransport$1.handle(AbstractByteArrayCommandTransport.java:61) 16:23:20 at org.jenkinsci.remoting.nio.NioChannelHub$2.run(NioChannelHub.java:594) 16:23:20 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 16:23:20 at java.util.concurrent.FutureTask.run(FutureTask.java:262) 16:23:20 at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112) 16:23:20 at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) 16:23:20 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 16:23:20 at java.util.concurrent.FutureTask.run(FutureTask.java:262) 16:23:20 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 16:23:20 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 16:23:20 at java.lang.Thread.run(Thread.java:745) 16:23:20 at ......remote call to mesos-jenkins-58207071568048808fbd9396283fe305-jenkins-slave-ru(Native Method) 16:23:20 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416) 16:23:20 at hudson.remoting.Request.call(Request.java:172) 16:23:20 at hudson.remoting.Channel.call(Channel.java:780) 16:23:20 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145) 16:23:20 at sun.reflect.GeneratedMethodAccessor756.invoke(Unknown Source) 16:23:20 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 16:23:20 at java.lang.reflect.Method.invoke(Method.java:606) 16:23:20 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131) 16:23:20 at com.sun.proxy.$Proxy88.execute(Unknown Source) 16:23:20 at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1042) 16:23:20 at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1082) 16:23:20 at hudson.scm.SCM.checkout(SCM.java:495) 16:23:20 at hudson.model.AbstractProject.checkout(AbstractProject.java:1269) 16:23:20 at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604) 16:23:20 at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) 16:23:20 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529) 16:23:20 at hudson.model.Run.execute(Run.java:1741) 16:23:20 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 16:23:20 at hudson.model.ResourceController.execute(ResourceController.java:98) 16:23:20 at hudson.model.Executor.run(Executor.java:410) 16:23:20 Caused by: hudson.remoting.Channel$OrderlyShutdown 16:23:20 at hudson.remoting.Channel$CloseCommand.execute(Channel.java:1080) 16:23:20 at hudson.remoting.Channel$1.handle(Channel.java:501) 16:23:20 at hudson.remoting.AbstractByteArrayCommandTransport$1.handle(AbstractByteArrayCommandTransport.java:61) 16:23:20 at org.jenkinsci.remoting.nio.NioChannelHub$2.run(NioChannelHub.java:594) 16:23:20 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 16:23:20 at java.util.concurrent.FutureTask.run(FutureTask.java:262) 16:23:20 at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112) 16:23:20 at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) 16:23:20 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 16:23:20 at java.util.concurrent.FutureTask.run(FutureTask.java:262) 16:23:20 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 16:23:20 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 16:23:20 at java.lang.Thread.run(Thread.java:745) 16:23:20 Caused by: Command close created at 16:23:20 at hudson.remoting.Command.<init>(Command.java:56) 16:23:20 at hudson.remoting.Channel$CloseCommand.<init>(Channel.java:1074) 16:23:20 at hudson.remoting.Channel$CloseCommand.<init>(Channel.java:1072) 16:23:20 at hudson.remoting.Channel.close(Channel.java:1156) 16:23:20 at hudson.remoting.Channel.close(Channel.java:1138) 16:23:20 at hudson.remoting.Channel$CloseCommand.execute(Channel.java:1079) 16:23:20 at hudson.remoting.Channel$1.handle(Channel.java:501) 16:23:20 at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:83)

            olivergondza Oliver Gondža
            olivergondza Oliver Gondža
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: