BB's implementation of SAL scheduling API has serializability requirement that's not in the API contract

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Low
    • None
    • Affects Version/s: None
    • Component/s: Plugin Development
    • 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.

            Assignee:
            Unassigned
            Reporter:
            Eli Bishop (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: