[JIRA] [core] (JENKINS-29888) Jenkins stuck when concurrent builds of a same job due to log rotator

2 views
Skip to first unread message

tazi.otmane@yahoo.fr (JIRA)

unread,
Aug 11, 2015, 5:15:03 AM8/11/15
to jenkinsc...@googlegroups.com
Otmane Tazi created an issue
 
Jenkins / Bug JENKINS-29888
Jenkins stuck when concurrent builds of a same job due to log rotator
Issue Type: Bug Bug
Assignee: Unassigned
Components: core
Created: 11/Aug/15 9:14 AM
Priority: Minor Minor
Reporter: Otmane Tazi

Hello,

I use Jenkins with parallel builds to checkout many packages.

Example:
parallel (
build(build("CheckOut-Package", PACKAGE_NAME: "Package1");
build(build("CheckOut-Package", PACKAGE_NAME: "Package2");
...
build(build("CheckOut-Package", PACKAGE_NAME: "Package10");
)

Each of these jobs calls the log rotator when finished.
Some time, next log appears:

SEVERE: Executor threw an exception
java.util.NoSuchElementException
at jenkins.model.lazy.LazyLoadRunMapEntrySet$1.next(LazyLoadRunMapEntrySet.java:76)
at jenkins.model.lazy.LazyLoadRunMapEntrySet$1.next(LazyLoadRunMapEntrySet.java:63)
at java.util.AbstractMap$2$1.next(AbstractMap.java:385)
at hudson.util.RunList.subList(RunList.java:139)
at hudson.tasks.LogRotator.perform(LogRotator.java:125)
at hudson.model.Job.logRotate(Job.java:467)
at hudson.model.Run.execute(Run.java:1808)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)

In this case, Jenkins does not detect that the job is finished even if it is indeed finished, and stay stucked.
Since log Rotator should not be a blocking task, I added an exception catch in this PR:
https://github.com/jenkinsci/jenkins/pull/1790

That was enough on my side to handle this very recurrent problem.

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

ogondza@gmail.com (JIRA)

unread,
Aug 11, 2015, 8:18:02 AM8/11/15
to jenkinsc...@googlegroups.com
Oliver Gondža updated an issue
Change By: Oliver Gondža
Hello,

I use Jenkins with parallel builds to checkout many packages.

Example:
{noformat}
parallel (
build(build("CheckOut-Package", PACKAGE_NAME: "Package1");
build(build("CheckOut-Package", PACKAGE_NAME: "Package2");
...
build(build("CheckOut-Package", PACKAGE_NAME: "Package10");
)
{noformat}

Each of these jobs calls the log rotator when finished.
Some time, next log appears:

{noformat}
SEVERE: Executor threw an exception
java.util.NoSuchElementException
        at jenkins.model.lazy.LazyLoadRunMapEntrySet$1.next(LazyLoadRunMapEntrySet.java:76)
        at jenkins.model.lazy.LazyLoadRunMapEntrySet$1.next(LazyLoadRunMapEntrySet.java:63)
        at java.util.AbstractMap$2$1.next(AbstractMap.java:385)
        at hudson.util.RunList.subList(RunList.java:139)
        at hudson.tasks.LogRotator.perform(LogRotator.java:125)
        at hudson.model.Job.logRotate(Job.java:467)
        at hudson.model.Run.execute(Run.java:1808)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:98)
        at hudson.model.Executor.run(Executor.java:374)
{noformat}

In this case, Jenkins does not detect that the job is finished even if it is indeed finished, and stay stucked.
Since log Rotator should not be a blocking task, I added an exception catch in this PR:
https://github.com/jenkinsci/jenkins/pull/1790

That was enough on my side to handle this very recurrent problem.

scm_issue_link@java.net (JIRA)

unread,
Oct 6, 2015, 8:19:05 AM10/6/15
to jenkinsc...@googlegroups.com
SCM/JIRA link daemon commented on Bug JENKINS-29888
 
Re: Jenkins stuck when concurrent builds of a same job due to log rotator

Code changed in jenkins
User: tfennelly
Path:
.gitignore
changelog.html
cli/pom.xml
core/pom.xml
core/src/main/java/hudson/model/AbstractProject.java
core/src/main/java/hudson/model/Run.java
core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly
core/src/main/resources/lib/form/confirm.js
core/src/main/resources/lib/form/select/select.js
core/src/main/resources/lib/layout/layout.jelly
plugins/pom.xml
pom.xml
test/pom.xml
test/src/test/groovy/hudson/model/AbstractProjectTest.groovy
war/pom.xml
http://jenkins-ci.org/commit/jenkins/95ca3da67d217c90d31819ec92e521e2072acd5a
Log:
Merge branch 'master' into plugin-manager-dependants

  • master:
    Update the changelog by new merges:
    [FIXED JENKINS-30569] HistoryWidget: fix JS syntax error
    [FIXED JENKINS-29014] render API link conditional on getApi() presence
    JENKINS-21720 JS alert preventig to leave a configuration page even without formulary changes
    add ctags file 'tags' to .gitignore
    [maven-release-plugin] prepare release jenkins-1.632
    [FIXED JENKINS-29888] Handling all exceptions returned by logRotator
    JENKINS-30742 Fixed possible NPE in AbstractProject.resolveForCLI()

scm_issue_link@java.net (JIRA)

unread,
Oct 13, 2015, 1:54:04 AM10/13/15
to jenkinsc...@googlegroups.com

scm_issue_link@java.net (JIRA)

unread,
Oct 13, 2015, 1:54:04 AM10/13/15
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Otmane TAZI
Path:
core/src/main/java/hudson/model/Run.java
http://jenkins-ci.org/commit/jenkins/1a5d57fdda3dba92543b8f486d3dce9cfb9c3811
Log:


[FIXED JENKINS-29888] Handling all exceptions returned by logRotator

scm_issue_link@java.net (JIRA)

unread,
Oct 13, 2015, 1:54:07 AM10/13/15
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Oleg Nenashev
Path:
core/src/main/java/hudson/model/Run.java
http://jenkins-ci.org/commit/jenkins/876e8e20505b705d07b561b34863938872240369
Log:
Merge pull request #1790 from tototoman/master

[FIXED JENKINS-29888] - Handling all LogRotator exceptions

scm_issue_link@java.net (JIRA)

unread,
Oct 13, 2015, 1:54:08 AM10/13/15
to jenkinsc...@googlegroups.com

jenkins@thorzten.de (JIRA)

unread,
Jan 15, 2016, 9:56:12 AM1/15/16
to jenkinsc...@googlegroups.com
Thorsten Möllers reopened an issue
 

Same issue occured two times just today on our Jenkins server.
Version: 1.625.3 (LTS)

From jenkins log:
Jan 15, 2016 1:33:38 PM hudson.model.Executor finish1


SEVERE: Executor threw an exception
java.util.NoSuchElementException
at jenkins.model.lazy.LazyLoadRunMapEntrySet$1.next(LazyLoadRunMapEntrySet.java:76)
at jenkins.model.lazy.LazyLoadRunMapEntrySet$1.next(LazyLoadRunMapEntrySet.java:63)
at java.util.AbstractMap$2$1.next(AbstractMap.java:385)
at hudson.util.RunList.subList(RunList.java:139)
at hudson.tasks.LogRotator.perform(LogRotator.java:125)
at hudson.model.Job.logRotate(Job.java:467)

at hudson.model.Run.execute(Run.java:1805)


at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)

at hudson.model.Executor.run(Executor.java:408)

Jan 15, 2016 11:27:15 AM hudson.model.Executor finish1


SEVERE: Executor threw an exception
java.util.NoSuchElementException
at jenkins.model.lazy.LazyLoadRunMapEntrySet$1.next(LazyLoadRunMapEntrySet.java:76)
at jenkins.model.lazy.LazyLoadRunMapEntrySet$1.next(LazyLoadRunMapEntrySet.java:63)
at java.util.AbstractMap$2$1.next(AbstractMap.java:385)
at hudson.util.RunList.subList(RunList.java:139)
at hudson.tasks.LogRotator.perform(LogRotator.java:125)
at hudson.model.Job.logRotate(Job.java:467)

at hudson.model.Run.execute(Run.java:1805)


at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)

at hudson.model.Executor.run(Executor.java:408)

Change By: Thorsten Möllers
Resolution: Fixed
Status: Resolved Reopened
Assignee: Régis Desgroppes

rdesgroppes@java.net (JIRA)

unread,
Jan 15, 2016, 9:59:07 AM1/15/16
to jenkinsc...@googlegroups.com

rdesgroppes@java.net (JIRA)

unread,
Jan 15, 2016, 10:00:02 AM1/15/16
to jenkinsc...@googlegroups.com

tib@hms.se (JIRA)

unread,
Jan 15, 2016, 10:15:06 AM1/15/16
to jenkinsc...@googlegroups.com
Timmy Brolin commented on Bug JENKINS-29888
 
Re: Jenkins stuck when concurrent builds of a same job due to log rotator

Happens somewhat frequently for us as well. Very annoying.
(Jenkins ver. 1.625.2)

luc.cary@gmail.com (JIRA)

unread,
May 11, 2016, 1:35:01 AM5/11/16
to jenkinsc...@googlegroups.com
Luc Cary commented on Bug JENKINS-29888

For a long time, this issue was making our CI cluster less reliable. We were on jenkins 1.625.2, and our build flow jobs would often hang when running in parallel. This was a bad user experience that made our CI pipelines flaky, since it either caused timeouts or required that we abort the build.

This was fixed for my team by upgrading to the latest stable version of jenkins core (1.651.1). I believe any version of jenkins before https://github.com/jenkinsci/jenkins/pull/1790/files was merged will have this bug, but upgrading to a newer jenkins version (any version after 1.633) should make the exception non-fatal and thus address the issue.

Reply all
Reply to author
Forward
0 new messages