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

liuhan pushed a commit to branch reduce-handle-connect-time
in repository https://gitbox.apache.org/repos/asf/skywalking-rover.git


The following commit(s) were added to refs/heads/reduce-handle-connect-time by 
this push:
     new 143a515  enable conntrack
143a515 is described below

commit 143a515091ba19cbc5f887ddf4bb58de654558ac
Author: mrproliu <[email protected]>
AuthorDate: Sat Dec 28 22:47:05 2024 +0800

    enable conntrack
---
 pkg/tools/ip/conntrack.go | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pkg/tools/ip/conntrack.go b/pkg/tools/ip/conntrack.go
index 70d93b1..fe18d79 100644
--- a/pkg/tools/ip/conntrack.go
+++ b/pkg/tools/ip/conntrack.go
@@ -19,6 +19,7 @@ package ip
 
 import (
        "context"
+       "fmt"
        "github.com/florianl/go-conntrack"
        "github.com/mdlayher/netlink"
        "golang.org/x/sys/unix"
@@ -155,7 +156,7 @@ func (c *ConnTrack) UpdateRealPeerAddress(addr *SocketPair, 
fromCacheOnly bool)
                addr.DestIP = v.realIP
                addr.DestPort = v.realPort
                addr.NeedConnTrack = false
-               log.Infof("update real peer address from cache: %s:%d", 
addr.DestIP, addr.DestPort)
+               log.Debugf("update real peer address from cache: %s:%d", 
addr.DestIP, addr.DestPort)
                c.monitorExpire.Delete(key)
                return nil
        }
@@ -177,15 +178,14 @@ func (c *ConnTrack) UpdateRealPeerAddress(addr 
*SocketPair, fromCacheOnly bool)
                session, e := c.queryClient.Get(conntrack.Conntrack, family, 
conntrack.Con{Origin: tuple})
                if e != nil {
                        // try to get the reply session, if the info not exists 
or from accept events, have error is normal
-                       log.Warnf("cannot get the conntrack session, type: %s, 
family: %d, origin src: %s:%d, origin dest: %s:%d, error: %v", info.name,
+                       return fmt.Errorf("cannot get the conntrack session, 
type: %s, family: %d, origin src: %s:%d, origin dest: %s:%d, error: %v", 
info.name,
                                family, tuple.Src, *tuple.Proto.SrcPort, 
tuple.Dst, *tuple.Proto.DstPort, e)
-                       continue
                }
 
                if res := c.filterValidateReply(session, tuple); res != nil {
                        addr.DestIP = res.Src.String()
                        addr.NeedConnTrack = false
-                       log.Infof("update real peer address from conntrack: 
%s:%d", addr.DestIP, addr.DestPort)
+                       log.Debugf("update real peer address from conntrack: 
%s:%d", addr.DestIP, addr.DestPort)
                        return nil
                }
        }

Reply via email to