-
Notifications
You must be signed in to change notification settings - Fork 194
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
Migrate from readResolve to unmarshal #528
Conversation
@Override public void close() { | ||
// it is possible for timings to be null if an old build (< v2686.v7c37e0578401) is being loaded from a saved state | ||
if (timings == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I basically just put back the null check that was removed in #519
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this addition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yikes, removed in #529
I wonder if this is not a symptom of inconsistent (or at least, surprising) deserialization, where |
I tested this really quickly by adding logger calls in each method, and it does look like only
Maybe? I took a quick look through |
That sounds appropriate. |
When I move the code to workflow-cps-plugin/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowExecution.java Line 1715 in 3f09155
timings is still null.
Looking at the stack trace, I realize it is only calling |
@car-roll I think you would need to inline |
@dwnusbaum thank you for pointing out that glaring error 🤦 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth adding a quick comment to ConverterImpl
:
// Note: XStream ignores readResolve and writeReplace methods on types with custom Converter implementations, so use marshal and unmarshal instead.
If a build is loaded from a saved state, and the build existed before #519 (i.e. v2686.v7c37e0578401), It is possible for the
timings
field to beNULL
. This causes an NPE when the Timing is closed:workflow-cps-plugin/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowExecution.java
Line 432 in 3f09155