-
Bug
-
Resolution: Won't Fix
-
Low
-
None
-
None
-
None
We found that a cross-product plugin using the PluginScheduler API, which worked in all other products, failed in Bitbucket Server with the following exception:
java.lang.IllegalArgumentException: PluginScheduler requires job data to be Serializable. key={}, valueClass={} at com.atlassian.stash.internal.sal.scheduling.PluginSchedulerAdapter.validateJobData(PluginSchedulerAdapter.java:101) ~[bitbucket-platform-4.0.1.jar:na] at com.atlassian.stash.internal.sal.scheduling.PluginSchedulerAdapter.scheduleJob(PluginSchedulerAdapter.java:47) ~[bitbucket-platform-4.0.1.jar:na]
However, according to the API documentation linked above, it's not true that "PluginScheduler requires job data to be Serializable". The documentation says that the job data map "will always be the same instance that is given to the job when it executes"; if it's serialized and then deserialized, it would not be the same instance. So this seems to be an undocumented deviation from the SAL API contract.
We have worked around this by using atlassian-scheduler-compat for code that needs to work in both Bitbucket and other products, but this is not ideal.
- Discovered while testing
-
AMKT-13686 Failed to load
Form Name |
---|
I understand, but for the record I disagree with your won't-fix rationale. "Deprecated" is not and should not be the same as "this doesn't work correctly even now".
Also, your statement about "the correct way to schedule a job" is unhelpful to developers who need to maintain compatibility with products and product versions that don't support atlassian-scheduler. That's why atlassian-scheduler-compat exists in the first place. I realize there aren't a lot of such cases, but UPM for instance is one of them.