wso2 / andes

Apache License 2.0
39 stars 128 forks source link

Fix EI-2347 #983

Closed sdkottegoda closed 6 years ago

sdkottegoda commented 6 years ago

Purpose

Fixes thread death when unsubscribing a subscription from UI. Resolves: https://github.com/wso2/product-ei/issues/2347

Approach

The underlying cause was a dead lock in the disruptor that occured when the DB recovery task runs. The DB recovery event(a disruptor event) detects conflicts of the connected node of local subscriptions and susbscriptions stored in the databse. Once a conflict is detected it disonnects the local subscription resulting in an event being published to the disruptor. This causes all disruptor handlers to hang thus MB being barely usable. The resolution for this is decouple the local subscription being deleted from the detection of the conflict.