Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More robust CpsFlowExecution.croak #837

Merged
merged 3 commits into from
Feb 16, 2024
Merged

More robust CpsFlowExecution.croak #837

merged 3 commits into from
Feb 16, 2024

Conversation

jglick
Copy link
Member

@jglick jglick commented Jan 22, 2024

The handling for a broken build in #809 seems to have been broken in the situation which #812 failed to reproduce:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script3: 8: unable to resolve class XXX 
 @ line 8, column 5.
       XXX xxx = null
       ^

Script3: 10: unable to resolve class XXX 
 @ line 10, column 20.
       void xxx(XXX xxx) {
                ^

2 errors

	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:309)
	at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:981)
	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:626)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:575)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:323)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:293)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox$Scope.parse(GroovySandbox.java:163)
	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:190)
	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:175)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:638)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.loadProgramAsync(CpsFlowExecution.java:855)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.onLoad(CpsFlowExecution.java:825)
	at org.jenkinsci.plugins.workflow.job.WorkflowRun.getExecution(WorkflowRun.java:719)
	at org.jenkinsci.plugins.workflow.job.WorkflowRun.onLoad(WorkflowRun.java:577)
	at …
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: …
	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:309)
	at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:981)
	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:626)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:575)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:323)
	at …
java.util.EmptyStackException
	at java.base/java.util.Stack.peek(Stack.java:102)
	at java.base/java.util.Stack.pop(Stack.java:84)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.onProgramEnd(CpsFlowExecution.java:1325)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.croak(CpsFlowExecution.java:914)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.loadProgramFailed(CpsFlowExecution.java:908)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.loadProgramAsync(CpsFlowExecution.java:893)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.onLoad(CpsFlowExecution.java:825)
	at org.jenkinsci.plugins.workflow.job.WorkflowRun.getExecution(WorkflowRun.java:719)
	at org.jenkinsci.plugins.workflow.job.WorkflowRun.onLoad(WorkflowRun.java:577)
	at …
ERROR: Failed to load program
Finished: FAILURE

@jglick jglick requested a review from a team as a code owner January 22, 2024 18:19
@jglick jglick added the bug label Jan 22, 2024
@jglick jglick changed the title Most robust CpsFlowExecution.croak More robust CpsFlowExecution.croak Jan 23, 2024
@jglick jglick requested a review from dwnusbaum February 16, 2024 19:17
@jglick jglick enabled auto-merge February 16, 2024 19:27
@jglick jglick merged commit 7f65cc8 into jenkinsci:master Feb 16, 2024
13 of 14 checks passed
@jglick jglick deleted the croak branch February 16, 2024 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants