[JIRA] (JENKINS-36243) ArrayIndexOutOfBoundsException with matrix and multiple simultaneous builds

0 views
Skip to first unread message

russell.gallop@gmail.com (JIRA)

unread,
Jun 27, 2016, 10:15:10 AM6/27/16
to jenkinsc...@googlegroups.com
Russell Gallop created an issue
 
Jenkins / Bug JENKINS-36243
ArrayIndexOutOfBoundsException with matrix and multiple simultaneous builds
Issue Type: Bug Bug
Assignee: Kohsuke Kawaguchi
Components: matrix-project-plugin, p4-plugin
Created: 2016/Jun/27 2:14 PM
Environment: jenkins 1.651.3
p4-plugin 1.4.2
matrix-project-plugin 1.7.1
Priority: Major Major
Reporter: Russell Gallop

Building multiple matrix builds (of one job) at once results in the following exception from the p4 plugin.

The job is configured as:
Multi-configuration project
Execute concurrent builds if necessary: true
p4 scm with a Manual workspace:
jenkins-$

{NODE_NAME}-${JOB_NAME}
//depot/tool/... //jenkins-${NODE_NAME}

-$

{JOB_NAME}

/...
User-defined Axis Name: "FOO" with Values "bar baz"
And a single build step executing a Windows batch command: "ping -n 10 127.0.0.1 >nul" to sleep for 10 seconds.

Trigger the same job at least twice in quick succession. The first succeeds but the subsequent ones get the above exception.

It appears to be a problem when the matrix per-configuration build uses the same node as the flyweight job. This is reproducible with a system with 1 executor on master.

{{Building on master in workspace C:\jenkins\jobs\matrix_p4_multiple_executions\ws@2\FOO\bar
FATAL: 1
java.lang.ArrayIndexOutOfBoundsException: 1
at org.jenkinsci.plugins.p4.tasks.AbstractTask.setEnvironment(AbstractTask.java:108)
at org.jenkinsci.plugins.p4.PerforceScm.checkout(PerforceScm.java:312)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1738)
at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)}}

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

russell.gallop@gmail.com (JIRA)

unread,
Jun 27, 2016, 10:16:03 AM6/27/16
to jenkinsc...@googlegroups.com
Russell Gallop updated an issue
Change By: Russell Gallop
Building multiple matrix builds (of one job) at once results in the following exception from the p4 plugin.

The job is configured as:
Multi-configuration project
Execute concurrent builds if necessary: true
p4 scm with  a Manual workspace:
   jenkins-${NODE_NAME}-${JOB_NAME}
   //depot/tool/... //jenkins-${NODE_NAME}-${JOB_NAME}/...
User-defined Axis Name: "FOO" with Values "bar baz"
And a single build step executing a Windows batch command: "ping -n 10 127.0.0.1 >nul" to sleep for 10 seconds.

Trigger the same job at least twice in quick succession. The first succeeds but the subsequent ones get the above exception.

It appears to be a problem when the matrix per-configuration build uses the same node as the flyweight job. This is reproducible with a system with 1 executor on master.

{ { quote}
Building on master in workspace C:\jenkins\jobs\matrix_p4_multiple_executions\ws@2\FOO\bar
FATAL: 1
java.lang.ArrayIndexOutOfBoundsException: 1
at org.jenkinsci.plugins.p4.tasks.AbstractTask.setEnvironment(AbstractTask.java:108)
at org.jenkinsci.plugins.p4.PerforceScm.checkout(PerforceScm.java:312)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1738)
at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)

{quote
} }

russell.gallop@gmail.com (JIRA)

unread,
Jun 27, 2016, 10:20:01 AM6/27/16
to jenkinsc...@googlegroups.com
Russell Gallop updated an issue
Building multiple matrix builds (of one job) at once results in the following exception from the p4 plugin.

The job is configured as:
Multi-configuration project
Execute concurrent builds if necessary: true
p4 scm with  a Manual workspace (viewname :
"    jenkins-$ \ {NODE_NAME \ } \ -$ \ {JOB_NAME \ }
", workspace: "    //depot/tool/... //jenkins-$ \ {NODE_NAME \ } \ -$ \ {JOB_NAME \ }/... ")
User-defined Axis Name: "FOO" with Values "bar baz"
And a single build step executing a Windows batch command: "ping -n 10 127.0.0.1 >nul" to sleep for 10 seconds.

Trigger the same job at least twice in quick succession. The first succeeds but the subsequent ones get the above exception.

It appears to be a problem when the matrix per-configuration build uses the same node as the flyweight job. This is reproducible with a system with 1 executor on master.

{quote}
Building on master in workspace C:\jenkins\jobs\matrix_p4_multiple_executions\ws@2\FOO\bar
FATAL: 1
java.lang.ArrayIndexOutOfBoundsException: 1
at org.jenkinsci.plugins.p4.tasks.AbstractTask.setEnvironment(AbstractTask.java:108)
at org.jenkinsci.plugins.p4.PerforceScm.checkout(PerforceScm.java:312)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1738)
at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
{quote}

russell.gallop@gmail.com (JIRA)

unread,
Jun 27, 2016, 10:21:02 AM6/27/16
to jenkinsc...@googlegroups.com

matthew_hall@sn.scee.net (JIRA)

unread,
Aug 26, 2016, 10:17:01 AM8/26/16
to jenkinsc...@googlegroups.com
Matthew Hall commented on Bug JENKINS-36243
 
Re: ArrayIndexOutOfBoundsException with matrix and multiple simultaneous builds

This problem can also occur in pipeline jobs.

Specifically it happens if a pipeline job is forcibly killed, via the 'Click here to forcibly kill entire build'
and then rerun

matthew_hall@sn.scee.net (JIRA)

unread,
Aug 26, 2016, 10:23:02 AM8/26/16
to jenkinsc...@googlegroups.com
Matthew Hall edited a comment on Bug JENKINS-36243
This problem can also occur in pipeline jobs.

Specifically it happens if a pipeline job is forcibly killed, via the 'Click here to forcibly kill entire build'

and then rerun
build it again:
[Pipeline] Allocate node : Start
Running on jslave-lin3 in /home/siadmin/jenkins/w/jendev/ll_self_host_12345@2
[Pipeline] node {
[Pipeline] Change current directory : Start
Running in /home/siadmin/jenkins/w/jendev/ll_self_host_12345@2/job_dsl
[Pipeline] dir {
[Pipeline] checkout
[Pipeline] } //dir
[Pipeline] Change current directory : End
[Pipeline] } //node
[Pipeline] Allocate node : End
[Pipeline] End of Pipeline
java.lang.ArrayIndexOutOfBoundsException: 1
at org.jenkinsci.plugins.p4.tasks.AbstractTask.setEnvironment(AbstractTask.java:109)
at org.jenkinsci.plugins.p4.PerforceScm.checkout(PerforceScm.java:292)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:83)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:73)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:49)
at hudson.security.ACL.impersonate(ACL.java:213)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:47)
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)
Finished: FAILURE

matthew_hall@sn.scee.net (JIRA)

unread,
Aug 26, 2016, 10:24:01 AM8/26/16
to jenkinsc...@googlegroups.com
Matthew Hall edited a comment on Bug JENKINS-36243
This problem can also occur in pipeline jobs.

Specifically it happens if a pipeline job is forcibly killed, via the 'Click here to forcibly kill entire build'  and then build it again:

matthew_hall@sn.scee.net (JIRA)

unread,
Aug 26, 2016, 10:28:02 AM8/26/16
to jenkinsc...@googlegroups.com
Matthew Hall edited a comment on Bug JENKINS-36243
This problem can also occur in pipeline jobs.

Specifically it happens if a pipeline job is forcibly killed, via the 'Click here to forcibly kill entire build'  and then build it again:

[Pipeline] Allocate node : Start
Running on jslave [agent - lin3 name] in ~ / home/siadmin/jenkins/w/jendev/ll_self_host_12345 job_name @2

[Pipeline] node {
[Pipeline] Change current directory : Start
Running in / home path / siadmin/jenkins/w/jendev/ll_self_host_12345 job_name @2/ job_dsl dir_name

pallen@perforce.com (JIRA)

unread,
Aug 26, 2016, 12:41:01 PM8/26/16
to jenkinsc...@googlegroups.com
Paul Allen started work on Bug JENKINS-36243
 
Change By: Paul Allen
Status: Open In Progress

pallen@perforce.com (JIRA)

unread,
Aug 30, 2016, 4:58:02 AM8/30/16
to jenkinsc...@googlegroups.com

The error looks to be due to unexpected subdirectories. The Perforce and Jenkins Workspace should be at the same level.

Could the error be similar to:
https://github.com/p4paul/p4-jenkins/issues/20

If you are not creating these sub-directories, I will need to work out a way to manage them.

russell.gallop@gmail.com (JIRA)

unread,
Sep 13, 2016, 12:28:01 PM9/13/16
to jenkinsc...@googlegroups.com

> If you are not creating these sub-directories, I will need to work out a way to manage them.

In the original case, using matrix builds we are not creating the sub-directories so I think we need the plugin to cope with this.

From https://github.com/p4paul/p4-jenkins/issues/20
> The Jenkins workspace and Perforce workspace should really be at the same path.

We also use git alongside perforce so use dir()

{ p4sync ...} as a common pattern to keep these separate. To my mind it is cleaner to have perforce checkout to a different directory from git otherwise the git checkout will be inside the perforce workspace. If I ask the p4 plugin to delete generated files then it would remove the git checkout!

We also have multiple perforce servers which would be used in some jobs. This would require multiple (perforce) workspaces which I believe would be bad to have in the same directory.

Please consider whether it would be possible to support the dir() { p4sync ...}

pattern. I don't think that Jenkins workspace and Perforce workspace being the same fits all use cases. dir()

{ p4sync... }

makes it much more flexible and also helps fulfil the promise of Jenkins pipeline DSL being able to truly support multiple SCMs.

pallen@perforce.com (JIRA)

unread,
Oct 13, 2016, 6:02:03 AM10/13/16
to jenkinsc...@googlegroups.com

pallen@perforce.com (JIRA)

unread,
Oct 13, 2016, 6:02:05 AM10/13/16
to jenkinsc...@googlegroups.com

pallen@perforce.com (JIRA)

unread,
Feb 8, 2018, 11:42:02 AM2/8/18
to jenkinsc...@googlegroups.com
Paul Allen closed an issue as Postponed
 

Closing old issues - issue may be fixed or not required. 

Change By: Paul Allen
Status: In Progress Closed
Resolution: Postponed
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages