[JIRA] (JENKINS-58764) Cancel Job aborts Agent Connection (JNLP)

5 views
Skip to first unread message

juergen.bohn@btc-es.de (JIRA)

unread,
Aug 1, 2019, 10:19:07 AM8/1/19
to jenkinsc...@googlegroups.com
Jürgen Bohn created an issue
 
Jenkins / Bug JENKINS-58764
Cancel Job aborts Agent Connection (JNLP)
Issue Type: Bug Bug
Assignee: Unassigned
Components: _unsorted
Created: 2019-08-01 14:18
Environment: Jenkins 2.150.3
Jenkins 2.176.2
Labels: regression
Priority: Critical Critical
Reporter: Jürgen Bohn

We run Jenkins 2.107.2 / 2.107.3 on Debian Linux server and >50 agents with linux, Win7, Win10 connected via JNLP.

Sometimes we use the possibility to cancel running jobs interactively without problems.

When upgrading the Jenkins server to 2.150.3 (and 2.176.2) and the agent jars appropriately, we get trouble. After canceling a job execution, the agent running the job looses the connection to the master. The agent's log says

java.nio.channels.ClosedChannelException
at org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
at org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:179)
at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

 

The master's log contains the following entries

Aug 01, 2019 9:35:00 AM hudson.model.Run execute
INFO: UTIL_cancel #1 aborted
java.lang.InterruptedException
at java.lang.Object.wait(Native Method)
at hudson.remoting.Request.call(Request.java:177)
at hudson.remoting.Channel.call(Channel.java:956)
at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:283)
at com.sun.proxy.$Proxy74.join(Unknown Source)
at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:1136)
at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:155)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
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:741)
at hudson.model.Build$BuildExecution.build(Build.java:206)
at hudson.model.Build$BuildExecution.doRun(Build.java:163)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1818)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)

Aug 01, 2019 9:35:02 AM jenkins.slaves.DefaultJnlpSlaveReceiver channelClosed
INFO: IOHub#1: Worker[channel:java.nio.channels.SocketChannel[connected local=/192.168.75.8:45607 remote=192.168.75.198/192.168.75.198:52076]] / Computer.threadPoolForRemoting 34 for R-Test-ST-Win7-64B-EN-Rhap-Agent2 terminated: java.nio.channels.ClosedChannelException

 

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

juergen.bohn@btc-es.de (JIRA)

unread,
Aug 9, 2019, 3:11:02 AM8/9/19
to jenkinsc...@googlegroups.com

juergen.bohn@btc-es.de (JIRA)

unread,
Aug 13, 2019, 6:28:02 AM8/13/19
to jenkinsc...@googlegroups.com
Jürgen Bohn commented on Bug JENKINS-58764
 
Re: Cancel Job aborts Agent Connection (JNLP)

I still analyze the problem ...

In Jenkins 2.107.2, where cancelling a job does not abort the agent's channels, I see the following Warning in the master's jenkins.log:

Aug 13, 2019 11:06:53 AM hudson.Launcher$RemoteLauncher$ProcImpl join
WARNING: Process hudson.Launcher$RemoteLauncher$ProcImpl@782007b6 has not really finished after the join() method completion

I have found this string in the source code of Jenkins in core/src/main/java/hudson/Launcher.java . There is a comment

this.isAlive()) { // Should never happen but this forces Proc to not be removed and early GC by escape analysis

so, this happens and in this older Jenkins release it is handled somehow without destroying the channel.
Perhaps this is a hint to someone about what may have changed in more recent Jenkins releases?

Reply all
Reply to author
Forward
0 new messages