WEBHOOKS-114 WebHookListenerCachingStore is not cluster safe
Richard Cordova
Branch: WEBHOOKS-114-webhooks-listener-cache-is-
Branch: master
Merged
Merged pull request
Merged in WEBHOOKS-114-webhooks-listener-cache-is- (pull request #74)
Merged in WEBHOOKS-114-webhooks-listener-cache-is- (pull request #74)
The original code used a map guarded by a cluster lock to cache listeners, however configuration changes were not being replicated across a cluster. I've reworked the caching store to use an atlassian-cache CachedReference instead.
The existing code had a copy on write pattern to avoid invalidating the entire map when one listener is added or removed. This optimisation has been lost but I wouldn't think it would have a big impact (cluster locks are expensive so this would be somewhat offset anyway). Thoughts welcome.