wso2 / andes

Apache License 2.0
39 stars 129 forks source link

Fix NullPointerException during messaging #936

Closed sdkottegoda closed 7 years ago

sdkottegoda commented 7 years ago

Purpose

Resolves wso2/product-ei#1113

Goals

Clears references for objects within Disruptor after usage.

Approach

Last event handler of the Disruptor clears all the object reference from the Disruptor event container objects. In the outbound disruptor, we have missed clearing some newly introduced objects, With this fix, we have added a new handler for clearing those objects as well from the Disruptor buffer.

User stories

N/A, this is a bug fix to prevent the server from going OOM.

Release note

Clear references for objects within Disruptor after usage.

Documentation

N/A, this is a bug fix

Training

N/A, this is a bug fix

Certification

N/A, this is a bug fix

Marketing

N/A, this is a bug fix

Automation tests

N/A, Need to manually test a heap dump to identify this. Since this is a probable OOM scenario.

Security checks

Samples

N/A, this is a bug fix

Related PRs

N/A, this is a bug fix

Migrations (if applicable)

N/A, this is a bug fix

Test environment

This can be reproduced with any JDK, OS and DB

Learning

This issue can be identified by taking a heap dump after publishing and consuming the message from the broker and checking for references of ProtocolMessage, AndesChannel, LocalSubscription objects from Disruptor.