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

ErrorAction.findOrigin failures due to ProxyException #328

Merged
merged 11 commits into from
May 16, 2024

Conversation

jglick
Copy link
Member

@jglick jglick commented May 16, 2024

A test case that passes on Java 11 but fails on 17; fix inspired by #327.

…
FINE	o.j.p.w.actions.ErrorAction#<init>: unable to serialize to XML
java.lang.reflect.InaccessibleObjectException: Unable to make field private static final long java.nio.channels.ClosedChannelException.serialVersionUID accessible: module java.base does not "opens java.nio.channels" to unnamed module @7c9d8e2
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
	at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
	at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
	at com.thoughtworks.xstream.converters.reflection.FieldDictionary.buildDictionaryEntryForClass(FieldDictionary.java:176)
	at com.thoughtworks.xstream.converters.reflection.FieldDictionary.buildMap(FieldDictionary.java:142)
	at com.thoughtworks.xstream.converters.reflection.FieldDictionary.fieldsFor(FieldDictionary.java:80)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:167)
	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:206)
…
Caused: java.lang.RuntimeException: Failed to serialize java.lang.Throwable#cause for class hudson.remoting.RequestAbortedException
	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:274)
	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:241)
	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:174)
…
[test0 #1] ERROR: Original failure:
[test0 #1] java.nio.channels.ClosedChannelException
[test0 #1] Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from localhost/127.0.0.1:55506
[test0 #1] 		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1787)
[test0 #1] 		at hudson.remoting.Request.call(Request.java:199)
[test0 #1] 		at hudson.remoting.Channel.call(Channel.java:1002)
[test0 #1] 		at hudson.FilePath.act(FilePath.java:1230)
[test0 #1] 		at hudson.FilePath.act(FilePath.java:1219)
[test0 #1] 		at org.jenkinsci.plugins.workflow.actions.ErrorActionTest$FailingStep.lambda$start$0(ErrorActionTest.java:316)
[test0 #1] 		at org.jenkinsci.plugins.workflow.steps.StepExecutions$SynchronousBodyVoid.lambda$asReturn$0(StepExecutions.java:45)
[test0 #1] 		at org.jenkinsci.plugins.workflow.steps.StepExecutions$SynchronousNonBlockingImpl.run(StepExecutions.java:99)
[test0 #1] 		at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
[test0 #1] 		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[test0 #1] 		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[test0 #1] Caused: hudson.remoting.RequestAbortedException
[test0 #1] 	at hudson.remoting.Request.abort(Request.java:346)
[test0 #1] 	at hudson.remoting.Channel.terminate(Channel.java:1083)
[test0 #1] 	at org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer.onReadClosed(ChannelApplicationLayer.java:241)
[test0 #1] 	at org.jenkinsci.remoting.protocol.ApplicationLayer.onRecvClosed(ApplicationLayer.java:221)
[test0 #1] 	at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:825)
[test0 #1] 	at org.jenkinsci.remoting.protocol.FilterLayer.onRecvClosed(FilterLayer.java:289)
[test0 #1] 	at org.jenkinsci.remoting.protocol.impl.SSLEngineFilterLayer.onRecvClosed(SSLEngineFilterLayer.java:168)
[test0 #1] 	at org.jenkinsci.remoting.protocol.ProtocolStack$Ptr.onRecvClosed(ProtocolStack.java:825)
[test0 #1] 	at org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:155)
[test0 #1] 	at org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:143)
[test0 #1] 	at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:789)
[test0 #1] 	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
[test0 #1] 	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
[test0 #1] 	at jenkins.util.ErrorLoggingExecutorService.lambda$wrap$0(ErrorLoggingExecutorService.java:51)
[test0 #1] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[test0 #1] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[test0 #1] 	at java.base/java.lang.Thread.run(Thread.java:840)
[test0 #1] Terminating callsFindOrigin (id: 3)
[test0 #1] [Pipeline] End of Pipeline
[test0 #1] java.lang.NullPointerException: Cannot invoke "org.jenkinsci.plugins.workflow.graph.FlowNode.getDisplayFunctionName()" because the return value of "org.jenkinsci.plugins.workflow.actions.ErrorAction.findOrigin(java.lang.Throwable, org.jenkinsci.plugins.workflow.flow.FlowExecution)" is null
[test0 #1] 	at org.jenkinsci.plugins.workflow.actions.ErrorActionTest$WrapperStep$Callback.onFailure(ErrorActionTest.java:293)
[test0 #1] Also:   org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 1d275cd9-e796-406e-9d7d-50050a41013b
[test0 #1] Caused: java.lang.AssertionError
[test0 #1] 	at org.jenkinsci.plugins.workflow.actions.ErrorActionTest$WrapperStep$Callback.onFailure(ErrorActionTest.java:295)
…

@jglick jglick requested a review from dwnusbaum May 16, 2024 21:49
@jglick jglick added the tests label May 16, 2024
Merge branch 'erroraction-id-proxyexception' into findOriginFromBodyExecutionCallback
@jglick jglick changed the title ErrorActionTest.findOriginFromBodyExecutionCallback ErrorAction.findOrigin failures due to ProxyException May 16, 2024
@jglick jglick added bug and removed tests labels May 16, 2024
@jglick jglick marked this pull request as ready for review May 16, 2024 22:47
@jglick jglick requested a review from a team as a code owner May 16, 2024 22:47
Comment on lines +211 to +212
var _t1 = t1;
var _t2 = t2;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise javac complains about nonfinal variables in lambdas, which is irritating since the complaint includes usages of t1 and t2 in previous clauses which are returning without ever running this block.

@jglick jglick enabled auto-merge May 16, 2024 22:53
@jglick jglick merged commit 4250456 into jenkinsci:master May 16, 2024
13 of 14 checks passed
@jglick jglick deleted the findOriginFromBodyExecutionCallback branch May 16, 2024 23:02
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