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

[JENKINS-54484] - Java 10 Support + clean + verify compatibility with old Program.Dat #77

Closed

Conversation

svanoort
Copy link
Member

@svanoort svanoort commented Oct 22, 2018

Updates #68 with explicit code coverage (@LocalData test) to test compatibility of program.dat written with current JBoss Marshalling (1.4.12-jenkins-3). From JW|DW Nice Community Hackfest.

Investigation showed that:

  • Errors are reproducible with any version of JBoss Marshalling 2.x - the program.dat can be read with JBoss River Marshalling 1.4.11.Final, fails with 2.0.0.Final through 2.0.6.Final

Diff link for Jboss Marshalling between those versions.

Unknown

  • Is the JBoss Marshalling guaranteed to be able to read the old format, or not?

Error reading the old Program.dat, from Marshalling 2.0.5.Final

"Executing testBasicSerializeDeserialize(org.jenkinsci.plugins.workflow.support.pickles.serialization.DeserializeUpdate)" Id=17 Group=FailOnTimeoutGroup RUNNABLE
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:828)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:205)
at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:76)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:1018)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1351)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:205)
at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:41)
at org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverReader$SandboxedUnmarshaller.lambda$readObject$0(RiverReader.java:250)
at org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverReader$SandboxedUnmarshaller$$Lambda$47/1859817612.call(Unknown Source)
at org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverReader$SandboxedUnmarshaller$$Lambda$48/1717469766.call(Unknown Source)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
at org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverReader$SandboxedUnmarshaller.sandbox(RiverReader.java:237)
at org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverReader$SandboxedUnmarshaller.readObject(RiverReader.java:250)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$2.onSuccess(CpsFlowExecution.java:782)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$2.onSuccess(CpsFlowExecution.java:775)
at org.jenkinsci.plugins.workflow.support.concurrent.Futures$1.run(Futures.java:150)
at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253)
at com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:149)
at com.google.common.util.concurrent.ExecutionList.add(ExecutionList.java:105)
at com.google.common.util.concurrent.AbstractFuture.addListener(AbstractFuture.java:155)
at org.jenkinsci.plugins.workflow.support.concurrent.Futures.addCallback(Futures.java:160)
at org.jenkinsci.plugins.workflow.support.concurrent.Futures.addCallback(Futures.java:90)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.loadProgramAsync(CpsFlowExecution.java:772)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.onLoad(CpsFlowExecution.java:739)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.getExecution(WorkflowRun.java:875)
- locked org.jenkinsci.plugins.workflow.job.WorkflowRun@1de5f0ef
at org.jenkinsci.plugins.workflow.job.WorkflowRun.onLoad(WorkflowRun.java:745)
- locked java.lang.Object@376a312c
at hudson.model.RunMap.retrieve(RunMap.java:225)
at hudson.model.RunMap.retrieve(RunMap.java:57)
at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:499)
at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:481)
at jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:379)
- locked hudson.model.RunMap@28d6290
at hudson.model.RunMap.getById(RunMap.java:205)
at org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.run(WorkflowRun.java:1112)
at org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.get(WorkflowRun.java:1123)
at org.jenkinsci.plugins.workflow.flow.FlowExecutionList$1.computeNext(FlowExecutionList.java:65)
at org.jenkinsci.plugins.workflow.flow.FlowExecutionList$1.computeNext(FlowExecutionList.java:57)
at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
at org.jenkinsci.plugins.workflow.flow.FlowExecutionList$ItemListenerImpl.onLoaded(FlowExecutionList.java:178)
at jenkins.model.Jenkins.(Jenkins.java:972)
at hudson.model.Hudson.(Hudson.java:85)
at org.jvnet.hudson.test.JenkinsRule.newHudson(JenkinsRule.java:617)
at org.jvnet.hudson.test.JenkinsRule.before(JenkinsRule.java:390)
at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:543)
at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.lang.Thread.run(Thread.java:748)

Root cause: gets a byte 0 for the first byte of the object, but isn't expecting 0.

History for unmarshaller: Github Jboss marshalling link to history.

Possible workaround suggestion from @olivergondza that we might shade the old JBoss marshalling version and fall back to it if the new marshaller fails -- if compat is important. Alternative workaround solution is to include a big compatibility warning in the changelog for the upgrade, and tell users to finish their Pipelines before upgrading.

Issue #2: Persistence After Shutdown Of Jenkins

This occurs with the above error - it seems likely to be caused by the error handling if we fail to load the Pipeline program, and manifests with the latest workflow-job and workflow-cps versions (2.25 and 2.59, respectively). The cause is that we're still trying to write Pipeline data even after Jenkins shutdown (Jenkins.getInstance() is null). It is likely an independent persistence model problem in workflow-cps -- and if resolved satisfactorily (or proven) to be so, we can probably release the JBoss bump with the workarounds above.

java.lang.NullPointerException
at jenkins.triggers.ReverseBuildTrigger$RunListenerImpl.calculateCache(ReverseBuildTrigger.java:256)
at jenkins.triggers.ReverseBuildTrigger$RunListenerImpl.onCompleted(ReverseBuildTrigger.java:286)
at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:211)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:807)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$1100(WorkflowRun.java:143)
at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1220)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1437)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:417)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:35)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
9.091 [id=52] WARNING o.j.p.w.flow.FlowExecutionList#unregister: Owner[serial-format/1:serial-format #1] was not in the list to begin with: []
9.100 [id=52] WARNING o.j.p.w.cps.CpsVmExecutorService#reportProblem: Unexpected exception in CPS VM thread: CpsFlowExecution[Owner[serial-format/1:serial-format #1]]

oleg-nenashev and others added 26 commits June 18, 2018 15:11
[JENKINS-52001] - Update JBoss Marshalling to 2.0.5.Final in order to get Java 9+ fixes
[JENKINS-52001] - Enable Incrementals deployment for the Java 10 support branch
/**
* Tests deserializing program.dat, useful to catch
*/
public class DeserializeUpdate {
Copy link
Member

Choose a reason for hiding this comment

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

Makes sense to upstream the test to the master branch. It is helpful independently of whether we merge it or not

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't generally upstream failing tests

Copy link
Member

Choose a reason for hiding this comment

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

But it should be passing on Java 8, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

@oleg-nenashev No, because the actual code binary format is different, on Java 8 as well -- it's the bump to the marshaller that does it, not the specific java version in use.

@oleg-nenashev oleg-nenashev self-requested a review November 6, 2018 09:53
@oleg-nenashev
Copy link
Member

Created https://issues.jenkins-ci.org/browse/JENKINS-54484 to track the problem separately

@oleg-nenashev oleg-nenashev changed the title Java 10 Support + clean + verify compatibility with old Program.Dat [JENKINS-54484] - Java 10 Support + clean + verify compatibility with old Program.Dat Nov 6, 2018
</dependency>
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>annotation-indexer</artifactId>
Copy link
Member

Choose a reason for hiding this comment

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

Should not be here. Defined in the parent POM.

@dwnusbaum
Copy link
Member

Superseded by #84.

@dwnusbaum dwnusbaum closed this Jan 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants