[JIRA] [workflow-plugin] (JENKINS-30055) Simple script with "long" loop created unloadable flow

15 views
Skip to first unread message

tom.fennelly@gmail.com (JIRA)

unread,
Aug 20, 2015, 8:50:01 AM8/20/15
to jenkinsc...@googlegroups.com
Tom FENNELLY created an issue
 
Jenkins / Bug JENKINS-30055
Simple script with "long" loop created unloadable flow
Issue Type: Bug Bug
Assignee: Jesse Glick
Components: workflow-plugin
Created: 20/Aug/15 12:49 PM
Priority: Major Major
Reporter: Tom FENNELLY

Create a workflow with a simple script containing a loop with e.g. 1000 iterations:

node {
  	stage 'Build'
	for (int i = 0; i < 1000; i++) {
		echo "hello: ${i}"
	}
}

Run the job a few times. Restart jenkins and try loading the job. you should see an error like:

*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at ../../../src/share/instrument/JPLISAgent.c line: 844
Aug 20, 2015 1:09:35 PM org.jenkinsci.plugins.workflow.job.WorkflowRun onLoad
WARNING: null
java.io.IOException: failed to load flow node from /Users/tfennelly/projects/jenkins-plugins/cloudbees-workflow-plugin/aggregator/work/jobs/WWW/builds/5/workflow/1008.xml
	at org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage$PersistenceContext.loadInner(SimpleXStreamFlowNodeStorage.java:227)
	at org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage$PersistenceContext.loadOuter(SimpleXStreamFlowNodeStorage.java:213)
	at org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage$PersistenceContext.access$100(SimpleXStreamFlowNodeStorage.java:185)
	at org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage.getNode(SimpleXStreamFlowNodeStorage.java:87)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.initializeStorage(CpsFlowExecution.java:397)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.onLoad(CpsFlowExecution.java:413)
	at org.jenkinsci.plugins.workflow.job.WorkflowRun.onLoad(WorkflowRun.java:380)
	at hudson.model.RunMap.retrieve(RunMap.java:223)
	at hudson.model.RunMap.retrieve(RunMap.java:57)
	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:465)
	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:448)
	at jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:356)
	at jenkins.model.lazy.LazyBuildMixIn.getBuildByNumber(LazyBuildMixIn.java:226)
	at org.jenkinsci.plugins.workflow.job.WorkflowJob.getBuildByNumber(WorkflowJob.java:199)
	at org.jenkinsci.plugins.workflow.job.WorkflowJob.getBuildByNumber(WorkflowJob.java:92)
	at jenkins.model.PeepholePermalink.resolve(PeepholePermalink.java:95)
	at hudson.model.Job.getLastSuccessfulBuild(Job.java:888)
	at jenkins.tasks.SimpleBuildStep$LastBuildActionFactory.createFor(SimpleBuildStep.java:111)
	at jenkins.tasks.SimpleBuildStep$LastBuildActionFactory.createFor(SimpleBuildStep.java:101)
	at hudson.model.Actionable.createFor(Actionable.java:107)
	at hudson.model.Actionable.getAllActions(Actionable.java:98)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
	at org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:314)
	at org.apache.commons.jexl.parser.ASTArrayAccess.evaluateExpr(ASTArrayAccess.java:185)
	at org.apache.commons.jexl.parser.ASTIdentifier.execute(ASTIdentifier.java:75)
	at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
	at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
	at org.apache.commons.jexl.parser.ASTElvisNode.value(ASTElvisNode.java:37)
	at org.apache.commons.jexl.parser.ASTExpression.value(ASTExpression.java:54)
	at org.apache.commons.jexl.parser.ASTElvisNode.value(ASTElvisNode.java:40)
	at org.apache.commons.jexl.parser.ASTExpression.value(ASTExpression.java:54)
	at org.apache.commons.jexl.parser.ASTExpressionExpression.value(ASTExpressionExpression.java:56)
	at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

tom.fennelly@gmail.com (JIRA)

unread,
Aug 20, 2015, 8:51:01 AM8/20/15
to jenkinsc...@googlegroups.com
Tom FENNELLY updated an issue
Change By: Tom FENNELLY
Create a workflow with a simple script containing a loop with e.g. 1000 iterations:

{code:java}

node {
   stage 'Build'
for (int i = 0; i < 1000; i++) {
echo "hello: ${i}"
}
}
{code}

Run the job a few times. Restart jenkins and try loading the job
. ,  you should see an error like:

{code}
{code}

jglick@cloudbees.com (JIRA)

unread,
Aug 21, 2015, 11:29:01 AM8/21/15
to jenkinsc...@googlegroups.com
Jesse Glick updated an issue
Change By: Jesse Glick
Labels: random robustness

jglick@cloudbees.com (JIRA)

unread,
Aug 21, 2015, 11:30:03 AM8/21/15
to jenkinsc...@googlegroups.com
Jesse Glick commented on Bug JENKINS-30055
 
Re: Simple script with "long" loop created unloadable flow

Smells like a race condition: perhaps a reference to a new flow node is saved before the node itself is.

jglick@cloudbees.com (JIRA)

unread,
Sep 25, 2015, 5:21:02 PM9/25/15
to jenkinsc...@googlegroups.com
Jesse Glick started work on Bug JENKINS-30055
 
Change By: Jesse Glick
Status: Open In Progress

jglick@cloudbees.com (JIRA)

unread,
Sep 25, 2015, 6:01:02 PM9/25/15
to jenkinsc...@googlegroups.com

Rather a file descriptor leak; the listener in DefaultStepContext gets notified asynchronously, so not fast enough to close the log files from completed steps.

Also a failure to ever remove the listener results in a quadratic slowdown. With that fixed, the insertion of

sleep unit: 'MILLISECONDS', time: 1

inside the loop lets it work, but without that extra pause the notifications just pile up undelivered and the error occurs.

jglick@cloudbees.com (JIRA)

unread,
Sep 25, 2015, 6:42:01 PM9/25/15
to jenkinsc...@googlegroups.com
Jesse Glick updated an issue
Change By: Jesse Glick
Labels: random performance  robustness

scm_issue_link@java.net (JIRA)

unread,
Jan 11, 2016, 1:37:03 PM1/11/16
to jenkinsc...@googlegroups.com
SCM/JIRA link daemon commented on Bug JENKINS-30055
 
Re: Simple script with "long" loop created unloadable flow

Code changed in jenkins
User: Jesse Glick
Path:
CHANGES.md
aggregator/src/test/java/org/jenkinsci/plugins/workflow/ScalabilityTest.java
api/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecution.java
cps/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowExecution.java
cps/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsThreadGroup.java
cps/src/main/java/org/jenkinsci/plugins/workflow/cps/FlowHead.java
job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
support/src/main/java/org/jenkinsci/plugins/workflow/support/DefaultStepContext.java
http://jenkins-ci.org/commit/workflow-plugin/1084a9bd2495989bb78e013c08c8348542e7955f
Log:
[FIXED JENKINS-30055] The listener which closes flow graph log files must receive events immediately, and unregister itself.

scm_issue_link@java.net (JIRA)

unread,
Jan 11, 2016, 1:37:03 PM1/11/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,
Jan 11, 2016, 1:37:04 PM1/11/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:
CHANGES.md
aggregator/src/test/java/org/jenkinsci/plugins/workflow/ScalabilityTest.java
api/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecution.java

api/src/main/java/org/jenkinsci/plugins/workflow/flow/GraphListener.java
api/src/main/java/org/jenkinsci/plugins/workflow/graph/BlockEndNode.java
api/src/main/java/org/jenkinsci/plugins/workflow/graph/FlowNode.java
api/src/main/java/org/jenkinsci/plugins/workflow/graph/ForkNode.java
api/src/main/java/org/jenkinsci/plugins/workflow/graph/JoinNode.java


cps/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowExecution.java
cps/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsThreadGroup.java
cps/src/main/java/org/jenkinsci/plugins/workflow/cps/FlowHead.java
job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
support/src/main/java/org/jenkinsci/plugins/workflow/support/DefaultStepContext.java

support/src/main/java/org/jenkinsci/plugins/workflow/support/storage/SimpleXStreamFlowNodeStorage.java
http://jenkins-ci.org/commit/workflow-plugin/0fdf534bce127223058749643753e2e9206fd448
Log:
Merge pull request #213 from jglick/many-steps-

JENKINS-30055

JENKINS-30055 Handle a large number of steps in quick succession

Compare: https://github.com/jenkinsci/workflow-plugin/compare/97ce55c78e77...0fdf534bce12

scm_issue_link@java.net (JIRA)

unread,
Jan 11, 2016, 1:37:04 PM1/11/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:

aggregator/src/test/java/org/jenkinsci/plugins/workflow/ScalabilityTest.java
support/src/main/java/org/jenkinsci/plugins/workflow/support/storage/SimpleXStreamFlowNodeStorage.java
http://jenkins-ci.org/commit/workflow-plugin/d3dc35a0f511610bd5ca56ea44317c4200c4953a
Log:
Reproduced the originally reported exception from

JENKINS-30055 , perhaps independent of JENKINS-30651 .

scm_issue_link@java.net (JIRA)

unread,
Apr 5, 2016, 3:53:12 PM4/5/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:

api/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecution.java
http://jenkins-ci.org/commit/workflow-api-plugin/f697e0cfd884f7106cb7066364b2eb372206c6a7


Log:
[FIXED JENKINS-30055] The listener which closes flow graph log files must receive events immediately, and unregister itself.

Originally-Committed-As: 1084a9bd2495989bb78e013c08c8348542e7955f

scm_issue_link@java.net (JIRA)

unread,
Apr 5, 2016, 4:04:12 PM4/5/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:

aggregator/src/test/java/org/jenkinsci/plugins/workflow/ScalabilityTest.java
support/src/main/java/org/jenkinsci/plugins/workflow/support/DefaultStepContext.java
http://jenkins-ci.org/commit/workflow-support-plugin/8379c0d2a7c4e36de305db68bc54acc2418b7c47


Log:
[FIXED JENKINS-30055] The listener which closes flow graph log files must receive events immediately, and unregister itself.
Originally-Committed-As: 1084a9bd2495989bb78e013c08c8348542e7955f

scm_issue_link@java.net (JIRA)

unread,
Apr 5, 2016, 4:04:15 PM4/5/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:
aggregator/src/test/java/org/jenkinsci/plugins/workflow/ScalabilityTest.java

support/src/main/java/org/jenkinsci/plugins/workflow/support/storage/SimpleXStreamFlowNodeStorage.java
http://jenkins-ci.org/commit/workflow-support-plugin/ad18aafe913d801eeb88594d89b176df024495b4


Log:
Reproduced the originally reported exception from

JENKINS-30055 , perhaps independent of JENKINS-30651 .

Originally-Committed-As: d3dc35a0f511610bd5ca56ea44317c4200c4953a

scm_issue_link@java.net (JIRA)

unread,
Apr 5, 2016, 4:31:28 PM4/5/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:

cps/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowExecution.java
cps/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsThreadGroup.java
cps/src/main/java/org/jenkinsci/plugins/workflow/cps/FlowHead.java
http://jenkins-ci.org/commit/workflow-cps-plugin/630edfb4313db63d01f6eb135cbce7081f496fae


Log:
[FIXED JENKINS-30055] The listener which closes flow graph log files must receive events immediately, and unregister itself.
Originally-Committed-As: 1084a9bd2495989bb78e013c08c8348542e7955f

scm_issue_link@java.net (JIRA)

unread,
Apr 5, 2016, 4:31:59 PM4/5/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:

job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
http://jenkins-ci.org/commit/workflow-job-plugin/35a9115af586c5c0f3283e9cbebcab62c647c7ee


Log:
[FIXED JENKINS-30055] The listener which closes flow graph log files must receive events immediately, and unregister itself.
Originally-Committed-As: 1084a9bd2495989bb78e013c08c8348542e7955f

Reply all
Reply to author
Forward
0 new messages