[JIRA] [core] (JENKINS-33681) Jenkins fails to restart with an exception

4 views
Skip to first unread message

michael@wyraz.de (JIRA)

unread,
Mar 21, 2016, 1:38:02 AM3/21/16
to jenkinsc...@googlegroups.com
Michael mic...@wyraz.de created an issue
 
Jenkins / Bug JENKINS-33681
Jenkins fails to restart with an exception
Issue Type: Bug Bug
Assignee: Unassigned
Components: core
Created: 2016/Mar/21 5:37 AM
Priority: Minor Minor
Reporter: Michael mic...@wyraz.de

I have multiple jenkins installations that are restarted from time to time (one by scheduled jenkins job, others when updating plugins). Since a few days (i would say since 1.653 update), restart from the UI fails with an exception and I need to restart jenkins via command line:

INFORMATION: Stopping Jenkins
Mär 21, 2016 6:29:27 AM jenkins.model.Jenkins _cleanUpDisconnectComputers
INFORMATION: Starting node disconnection
Mär 21, 2016 6:29:28 AM hudson.TcpSlaveAgentListener$ConnectionHandler run
INFORMATION: Accepted connection #1 from /127.0.0.1:53515
Mär 21, 2016 6:29:28 AM jenkins.model.Jenkins _cleanUpShutdownPluginManager
INFORMATION: Stopping plugin manager
Mär 21, 2016 6:29:28 AM hudson.plugins.im.JenkinsIsBusyListener removeConnectionProvider
INFORMATION: Last connection provider removed. Unregistering this instance.
Mär 21, 2016 6:29:28 AM jenkins.model.Jenkins _cleanUpPersistQueue
INFORMATION: Persisting build queue
Mär 21, 2016 6:29:28 AM jenkins.model.Jenkins _cleanUpAwaitDisconnects
INFORMATION: Waiting for node disconnection completion
Mär 21, 2016 6:29:28 AM jenkins.model.Jenkins _cleanUpPluginServletFilters
SCHWERWIEGEND: Failed to stop filters
java.lang.UnsupportedOperationException
at java.util.concurrent.CopyOnWriteArrayList$COWIterator.remove(CopyOnWriteArrayList.java:1176)
at hudson.util.PluginServletFilter.cleanUp(PluginServletFilter.java:162)
at jenkins.model.Jenkins._cleanUpPluginServletFilters(Jenkins.java:3237)
at jenkins.model.Jenkins.cleanUp(Jenkins.java:2890)
at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:70)
at jenkins.model.Jenkins$27.run(Jenkins.java:3846)

Mär 21, 2016 6:29:28 AM jenkins.model.Jenkins cleanUp
INFORMATION: Jenkins stopped
Mär 21, 2016 6:29:28 AM jenkins.model.Jenkins$27 run
WARNUNG: Failed to restart Jenkins
java.lang.RuntimeException: Unexpected issues encountered during cleanUp: null
at jenkins.model.Jenkins.cleanUp(Jenkins.java:2905)
at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:70)
at jenkins.model.Jenkins$27.run(Jenkins.java:3846)
Caused by: java.lang.UnsupportedOperationException
at java.util.concurrent.CopyOnWriteArrayList$COWIterator.remove(CopyOnWriteArrayList.java:1176)
at hudson.util.PluginServletFilter.cleanUp(PluginServletFilter.java:162)
at jenkins.model.Jenkins._cleanUpPluginServletFilters(Jenkins.java:3237)
at jenkins.model.Jenkins.cleanUp(Jenkins.java:2890)
... 2 more

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

andrew@ingenerator.com (JIRA)

unread,
Mar 21, 2016, 5:49:01 AM3/21/16
to jenkinsc...@googlegroups.com
Andrew Coulton commented on Bug JENKINS-33681
 
Re: Jenkins fails to restart with an exception

I have the same problem, which appears to have been introduced by the call to iterator.remove() introduced in 1.653 by https://github.com/jenkinsci/jenkins/commit/abf9fd36582ce6277dec929e89f078678e587209 which was a fix for https://issues.jenkins-ci.org/browse/JENKINS-33384

I'm not a java developer, but it looks questionable to me whether that code has ever worked? Oracle's Java 7 docs for CopyOnWriteArrayList say:

Element-changing operations on iterators themselves (remove, set, and add) are not supported. These methods throw UnsupportedOperationException.

As far as I can see PluginServletFilter.list has been a CopyOnWriteArrayList since December 2014 .

andrew@ingenerator.com (JIRA)

unread,
Mar 21, 2016, 5:52:01 AM3/21/16
to jenkinsc...@googlegroups.com

andrew@ingenerator.com (JIRA)

unread,
Mar 21, 2016, 5:54:01 AM3/21/16
to jenkinsc...@googlegroups.com
 
Re: Jenkins fails to restart with an exception

I've updated the priority from Minor to Major, as this is outright preventing restarting Jenkins except with a full shutdown / restart from the shell. I hope that's OK.

stephenconnolly@java.net (JIRA)

unread,
Mar 21, 2016, 10:24:01 AM3/21/16
to jenkinsc...@googlegroups.com

stephenconnolly@java.net (JIRA)

unread,
Mar 21, 2016, 10:25:02 AM3/21/16
to jenkinsc...@googlegroups.com
stephenconnolly started work on Bug JENKINS-33681
 
Change By: stephenconnolly
Status: Open In Progress

scm_issue_link@java.net (JIRA)

unread,
Mar 21, 2016, 12:58:02 PM3/21/16
to jenkinsc...@googlegroups.com
SCM/JIRA link daemon commented on Bug JENKINS-33681
 
Re: Jenkins fails to restart with an exception

Code changed in jenkins
User: Stephen Connolly
Path:
core/src/main/java/hudson/util/PluginServletFilter.java
http://jenkins-ci.org/commit/jenkins/a5febd7666fd78542d45428505cc62c067315c43
Log:
[FIXED JENKINS-33681] Plugin filters were failing to be removed and blocking restart

scm_issue_link@java.net (JIRA)

unread,
Mar 21, 2016, 12:58:02 PM3/21/16
to jenkinsc...@googlegroups.com
SCM/JIRA link daemon resolved as Fixed
 
Change By: SCM/JIRA link daemon
Status: In Progress Resolved
Resolution: Fixed

scm_issue_link@java.net (JIRA)

unread,
Mar 21, 2016, 12:58:03 PM3/21/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Stephen Connolly
Path:
core/src/main/java/hudson/util/PluginServletFilter.java

http://jenkins-ci.org/commit/jenkins/ee1ff1fdac86cee9e1ddaeacde61d0361720d4ea
Log:
Merge pull request #2147 from stephenc/jenkins-33681

[FIXED JENKINS-33681] Plugin filters were failing to be removed and blocking restart

dogfood@java.net (JIRA)

unread,
Mar 21, 2016, 2:04:03 PM3/21/16
to jenkinsc...@googlegroups.com
dogfood commented on Bug JENKINS-33681

Integrated in jenkins_main_trunk #4520
[FIXED JENKINS-33681] Plugin filters were failing to be removed and (Revision a5febd7666fd78542d45428505cc62c067315c43)

Result = UNSTABLE
stephen connolly : a5febd7666fd78542d45428505cc62c067315c43
Files :

  • core/src/main/java/hudson/util/PluginServletFilter.java

michael@wyraz.de (JIRA)

unread,
Mar 21, 2016, 3:18:02 PM3/21/16
to jenkinsc...@googlegroups.com

Great works, thank you. I give feedback as soon as the next release is rolled out.

andrew@ingenerator.com (JIRA)

unread,
Mar 21, 2016, 6:24:01 PM3/21/16
to jenkinsc...@googlegroups.com

Great, thanks for the quick response.

escoem@gmail.com (JIRA)

unread,
Mar 22, 2016, 4:26:02 AM3/22/16
to jenkinsc...@googlegroups.com

ogondza@gmail.com (JIRA)

unread,
Mar 30, 2016, 4:05:02 AM3/30/16
to jenkinsc...@googlegroups.com
Oliver Gondža updated an issue
Change By: Oliver Gondža
Labels: lts 1.651 - candidate fixed

ogondza@gmail.com (JIRA)

unread,
Mar 30, 2016, 6:01:02 AM3/30/16
to jenkinsc...@googlegroups.com
Oliver Gondža updated an issue
Change By: Oliver Gondža
Labels: 1.651 .1 -fixed

scm_issue_link@java.net (JIRA)

unread,
Mar 30, 2016, 6:39:02 AM3/30/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Stephen Connolly
Path:
core/src/main/java/hudson/util/PluginServletFilter.java

http://jenkins-ci.org/commit/jenkins/c57af86955c2c799930a93cd955ed7f98c7dc504
Log:
[FIXED JENKINS-33681] Plugin filters were failing to be removed and blocking restart

(cherry picked from commit a5febd7666fd78542d45428505cc62c067315c43)

stephenconnolly@java.net (JIRA)

unread,
Jul 13, 2016, 5:08:16 AM7/13/16
to jenkinsc...@googlegroups.com
stephenconnolly closed an issue as Fixed
 
Change By: stephenconnolly
Status: Resolved Closed
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages