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

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


The following commit(s) were added to refs/heads/master by this push:
     new cd8588e0 fix:Reclaim the heartbeat response message to avoid memory 
leakage of GettyRemoting.futures (#665)
cd8588e0 is described below

commit cd8588e0909fd6b0f458fb0c3d47ab676e01d672
Author: JayLiu <[email protected]>
AuthorDate: Sat Dec 21 17:28:02 2024 +0800

    fix:Reclaim the heartbeat response message to avoid memory leakage of 
GettyRemoting.futures (#665)
    
    * fix:回收心跳response消息,以避免GettyRemoting.futures内存泄露
    
    * remove chinese comment
    
    ---------
    
    Co-authored-by: tanzegen <[email protected]>
    Co-authored-by: Xin Wang <[email protected]>
---
 pkg/remoting/processor/client/client_heart_beat_processon.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pkg/remoting/processor/client/client_heart_beat_processon.go 
b/pkg/remoting/processor/client/client_heart_beat_processon.go
index 0ba2f58c..c3822c54 100644
--- a/pkg/remoting/processor/client/client_heart_beat_processon.go
+++ b/pkg/remoting/processor/client/client_heart_beat_processon.go
@@ -38,5 +38,9 @@ func (f *clientHeartBeatProcessor) Process(ctx 
context.Context, rpcMessage messa
                        log.Debug("received PONG from {}", ctx)
                }
        }
+       msgFuture := 
getty.GetGettyRemotingInstance().GetMessageFuture(rpcMessage.ID)
+       if msgFuture != nil {
+               
getty.GetGettyRemotingInstance().RemoveMessageFuture(rpcMessage.ID)
+       }
        return nil
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to