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

Transient atomics to prevent serialization issues #26

Merged
merged 1 commit into from
Jun 19, 2020
Merged

Transient atomics to prevent serialization issues #26

merged 1 commit into from
Jun 19, 2020

Conversation

res0nance
Copy link
Contributor

Make the atomics transient to prevent JEP-200 warnings

WARNING: Failed to save D:\github\cloudbees-disk-usage-simple-plugin\work\cloudbees-disk-usage-simple.xml
java.io.IOException: java.lang.RuntimeException: Failed to serialize com.cloudbees.simplediskusage.QuickDiskUsagePlugin#progress for class com.cloudbees.simplediskusage.QuickDiskUsagePlugin
        at hudson.XmlFile.write(XmlFile.java:200)
        at hudson.Plugin.save(Plugin.java:278)
        at com.cloudbees.simplediskusage.QuickDiskUsagePlugin$2.run(QuickDiskUsagePlugin.java:267)
        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)
Caused by: java.lang.RuntimeException: Failed to serialize com.cloudbees.simplediskusage.QuickDiskUsagePlugin#progress for class com.cloudbees.simplediskusage.QuickDiskUsagePlugin
        at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
        at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
        at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
        at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
        at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
        at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
        at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
        at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
        at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
        at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
        at com.thoughtworks.xstream.XStream.marshal(XStream.java:1026)
        at com.thoughtworks.xstream.XStream.marshal(XStream.java:1015)
        at com.thoughtworks.xstream.XStream.toXML(XStream.java:988)
        at hudson.XmlFile.write(XmlFile.java:193)
        ... 5 more
Caused by: java.lang.UnsupportedOperationException: Refusing to marshal java.util.concurrent.atomic.AtomicInteger for security reasons; see https://jenkins.io/redirect/class-filter/
        at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:546)
        at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
        at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
        at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
        at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
        at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
        ... 18 more

@aheritier
Copy link
Member

I am not a JEP-200 expert but the change looks ok to me

@aheritier
Copy link
Member

I think this one is safe @timja These data aren't supposed to be store. WDYT ?

@timja
Copy link
Member

timja commented Jun 19, 2020

I think this one is safe @timja These data aren't supposed to be store. WDYT ?

Safe, transient means don't store it and we don't want it stored.
So nice simple fix.

I think I saw the same issue / fix in the cloud-stats plugin as well

@aheritier aheritier merged commit d00c7a6 into jenkinsci:master Jun 19, 2020
@timja
Copy link
Member

timja commented Jun 30, 2020

@aheritier could this be released please? getting this log in my instance

@aheritier
Copy link
Member

yes sure @timja
I will do it later today

@aheritier
Copy link
Member

all done... should land in UCs "soon"

@timja
Copy link
Member

timja commented Jun 30, 2020

perfect thanks

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.

3 participants