jenkinsci / jenkinsci/workflow-support-plugin

[JENKINS-25925] More polite reporting of NotSerializableException

Open
#375 6 comments 0 reactions 0 assignees View on GitHub
component:workflow-support-plugin imported-jira-issue priority:major resolution:unresolved robustness
Dominant language
Java
Stars
23
Forks
75
PR merge metrics
No merged PRs in 30d

Description

If you accidentally store something nonserializable in a local variable, you get a nasty stack trace mentioning org.jboss.marshalling.river.RiverMarshaller.doWriteObject and other things which will make no sense to a user and imply a bug in Workflow rather than in your script.

RiverWriter should defend better against this. It could replace the bad object with null, after printing a warning in the log. Or it could simply replace it with a pickle that rehydrates to null or throws an exception if you ever resume this flow after a restart. I think replacement with null is preferable since in most cases you did not really need the object to be saved and the flow could have continued without it.

---
Originally reported by jglick, imported from: More polite reporting of NotSerializableException


  • assignee: kohsuke
  • status: Open
  • priority: Major
  • component(s): workflow-support-plugin
  • label(s): robustness, serialization
  • resolution: Unresolved
  • votes: 7
  • watchers: 11
  • imported: 20260601-173816

Raw content of original issue

If you accidentally store something nonserializable in a local variable, you get a nasty stack trace mentioning org.jboss.marshalling.river.RiverMarshaller.doWriteObject and other things which will make no sense to a user and imply a bug in Workflow rather than in your script.

RiverWriter should defend better against this. It could replace the bad object with null, after printing a warning in the log. Or it could simply replace it with a pickle that rehydrates to null or throws an exception if you ever resume this flow after a restart. I think replacement with null is preferable since in most cases you did not really need the object to be saved and the flow could have continued without it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.