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 36b19a5 update conntrack
36b19a5 is described below
commit 36b19a5dd148b02641f201302a5265e2e4c4b1a7
Author: mrproliu <[email protected]>
AuthorDate: Sat Dec 28 16:18:10 2024 +0800
update conntrack
---
pkg/accesslog/collector/connection.go | 2 ++
pkg/tools/ip/conntrack.go | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/pkg/accesslog/collector/connection.go
b/pkg/accesslog/collector/connection.go
index f56ed05..93f8d39 100644
--- a/pkg/accesslog/collector/connection.go
+++ b/pkg/accesslog/collector/connection.go
@@ -389,6 +389,8 @@ func (c *ConnectionPartitionContext)
TryToUpdateSocketFromConntrack(event *event
originalPort := socket.DestPort
err := c.connTracker.UpdateRealPeerAddress(socket)
if err != nil {
+ log.Warnf("update the socket address from conntrack
failure, connection ID: %d, randomID: %d, error: %v",
+ event.ConID, event.RandomID, err)
return fmt.Errorf("update the socket address from
conntrack failure, error: %v", err)
}
connectionLogger.Infof("update the socket address from
conntrack success, "+
diff --git a/pkg/tools/ip/conntrack.go b/pkg/tools/ip/conntrack.go
index 6fc3855..32ee090 100644
--- a/pkg/tools/ip/conntrack.go
+++ b/pkg/tools/ip/conntrack.go
@@ -169,7 +169,7 @@ func (c *ConnTrack) UpdateRealPeerAddress(addr *SocketPair)
error {
v := val.(conntrackExpireValue)
addr.DestIP = v.realIP
addr.DestPort = v.realPort
- log.Debugf("update real peer address: %s:%d", addr.DestIP,
addr.DestPort)
+ log.Infof("update real peer address from cache: %s:%d",
addr.DestIP, addr.DestPort)
c.monitorExpire.Delete(key)
return nil
}
@@ -200,6 +200,7 @@ func (c *ConnTrack) UpdateRealPeerAddress(addr *SocketPair)
error {
if err != nil {
return err
}
+ log.Infof("update real peer address from conntrack: %s:%d",
get.TupleReply.IP.SourceAddress.String(), get.TupleReply.Proto.SourcePort)
addr.DestIP = get.TupleReply.IP.SourceAddress.String()
addr.DestPort = get.TupleReply.Proto.SourcePort