concurrencyService breaks on reload

The concurrencyService.getBucketedExecutor breaks when reinstalling the plugin. If you use a custom class as the serializable message, it fails to cast it to itself. If you use JSON serialization and pass the string as a message you don’t have access to any service because they get destroyed

[INFO] 2021-05-13 14:25:36,977 ERROR [com.fourpsa.bitbucket.service.ScriptService.JSON1:thread-1]  c.a.s.i.c.HazelcastBucketedExecutor Attempt 2 of 2 at processing bucket 'com.fourpsa.bitbucket.service.ScriptService.JSON1@' for executor 'com.fourpsa.bitbucket.service.ScriptService.JSON1' failed:
[INFO] org.eclipse.gemini.blueprint.service.importer.ServiceProxyDestroyedException: service proxy has been destroyed
[INFO] 	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceDynamicInterceptor$ServiceLookUpCallback.doWithRetry(ServiceDynamicInterceptor.java:101)
[INFO] 	at org.eclipse.gemini.blueprint.service.importer.support.internal.support.RetryTemplate.execute(RetryTemplate.java:81)
[INFO] 	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceDynamicInterceptor.lookupService(ServiceDynamicInterceptor.java:427)
[INFO] 	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceDynamicInterceptor.getTarget(ServiceDynamicInterceptor.java:400)
[INFO] 	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
[INFO] 	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
[INFO] 	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
[INFO] 	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
[INFO] 	at com.fourpsa.bitbucket.service.ScriptService.process(ScriptService.java:100)
[INFO] 	at com.atlassian.stash.internal.concurrent.HazelcastBucketedExecutor$BucketProcessingBootstrapper.run(HazelcastBucketedExecutor.java:146)
[INFO] 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[INFO] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[INFO] 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
[INFO] 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
[INFO] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[INFO] 	at java.lang.Thread.run(Thread.java:748)
[INFO] 	... 12 frames trimmed

Does anybody have a fix for this?