Atlassian bug in CacheManager - disabling plugin can cause server failure
See https://ecosystem.atlassian.net/browse/CACHE-240 "Shutting down app that imports CacheManager kills entire instance"
Atlassian is looking at the problem and we will track it here until they have a bug fix or a recommended workaround for plugins.
Developer community thread: https://community.developer.atlassian.com/t/atlassian-cache-crashes-confluence-jira-upon-app-disable/37062/16
[INFO] [talledLocalContainer] java.lang.Exception: Stack trace
[INFO] [talledLocalContainer] at java.lang.Thread.dumpStack(Thread.java:1336)
[INFO] [talledLocalContainer] at com.tngtech.confluence.plugins.example.atlassiancachecrash.SpringConfig$DebuggableCacheManager.shutdown(SpringConfig.java:56)
[INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:498)
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.DisposableBeanAdapter.invokeCustomDestroyMethod(DisposableBeanAdapter.java:339)
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:273)
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:571)
[INFO] [talledLocalContainer] at org.springf
Create a Support Ticket
"Thanks for your feedback.
Firstly, be reassured that Spring only shuts down the CacheManager if it was imported by an @Bean method, not by an XML component-import element or even Spring Scanner’s @ComponentImport annotation. So your plugin is OK and so are most of the others that use CacheManager. I think you’d know by now (or certainly in your pre-release testing) if disabling your plugin caused the entire product to crash. 🙂
I’m aware that a lot of our documentation says to use CacheManager. On the other hand, you can see from looking at the code that CacheManager is annotated with @Internal (i.e. not intended for use by plugins), whereas CacheFactory is annotated as @PublicApi. I’m trying to resolve these contradictions in the documentation, just not as part of CACHE-240 Closed , because it’s not a bug in atlassian-cache . FWIW, my preferred solution is to make each product’s CacheFactory implementation suitable for use by plugins, to preserve the API promises we’ve made in our annotations, and fix the documentation accordingly. The problem with Confluence’s CacheFactory is tracked separately, because it requires a change to that product, not atlassian-cache."