You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by ty...@apache.org on 2021/08/04 02:17:16 UTC

[incubator-shenyu] branch master updated: fix disruptor : fix the problem of hold event data in consume event (#1858)

This is an automated email from the ASF dual-hosted git repository.

tydhot pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new 71660db  fix disruptor : fix the problem of hold event data in consume event (#1858)
71660db is described below

commit 71660dba3396dfd560a39f2e8411c89ea714e2ed
Author: Switch <sw...@163.com>
AuthorDate: Wed Aug 4 10:17:07 2021 +0800

    fix disruptor : fix the problem of hold event data in consume event (#1858)
---
 .../main/java/org/apache/shenyu/disruptor/consumer/QueueConsumer.java   | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/shenyu-disruptor/src/main/java/org/apache/shenyu/disruptor/consumer/QueueConsumer.java b/shenyu-disruptor/src/main/java/org/apache/shenyu/disruptor/consumer/QueueConsumer.java
index ca5cf72..06255a0 100644
--- a/shenyu-disruptor/src/main/java/org/apache/shenyu/disruptor/consumer/QueueConsumer.java
+++ b/shenyu-disruptor/src/main/java/org/apache/shenyu/disruptor/consumer/QueueConsumer.java
@@ -49,6 +49,8 @@ public class QueueConsumer<T> implements WorkHandler<DataEvent<T>> {
         if (t != null) {
             QueueConsumerExecutor<T> queueConsumerExecutor = factory.create();
             queueConsumerExecutor.setData(t.getData());
+            // help gc
+            t.setData(null);
             executor.execute(queueConsumerExecutor);
         }
     }