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

liuhan pushed a commit to branch test-log
in repository https://gitbox.apache.org/repos/asf/skywalking-rover.git


The following commit(s) were added to refs/heads/test-log by this push:
     new 71a49be  update logic
71a49be is described below

commit 71a49be96220297c82e0af55c86ed8457a9dedb6
Author: mrproliu <[email protected]>
AuthorDate: Tue Mar 4 17:42:10 2025 +0800

    update logic
---
 pkg/accesslog/common/connection.go | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/pkg/accesslog/common/connection.go 
b/pkg/accesslog/common/connection.go
index be6d2e8..e80262c 100644
--- a/pkg/accesslog/common/connection.go
+++ b/pkg/accesslog/common/connection.go
@@ -624,6 +624,21 @@ func (c *ConnectionManager) OnBuildConnectionLogFinished() 
{
 }
 
 func (c *ConnectionManager) SkipAllDataAnalyzeAndDowngradeProtocol(conID, 
ranID uint64) {
+       // setting connection protocol is break
+       connectionKey := fmt.Sprintf("%d_%d", conID, ranID)
+       data, exist := c.connections.Get(connectionKey)
+       if exist {
+               connection := data.(*ConnectionInfo)
+               connection.ProtocolBreak = true
+               log.Infof("detected the existing connection: %d-%d is protocol 
break",
+                       conID, ranID)
+       } else {
+               // setting to the protocol break map for encase the runner not 
starting building logs
+               c.connectionProtocolBreakMap.Set(connectionKey, true, 
time.Minute)
+               log.Infof("setting the connection: %d-%d to protocol break 
map", conID, ranID)
+       }
+
+       // setting the connection skip data upload
        var activateConn ActiveConnection
        if err := c.activeConnectionMap.Lookup(conID, &activateConn); err != 
nil {
                if errors.Is(err, ebpf.ErrKeyNotExist) {
@@ -641,19 +656,6 @@ func (c *ConnectionManager) 
SkipAllDataAnalyzeAndDowngradeProtocol(conID, ranID
        if err := c.activeConnectionMap.Update(conID, activateConn, 
ebpf.UpdateAny); err != nil {
                log.Warnf("failed to update the active connection: %d-%d", 
conID, ranID)
        }
-
-       connectionKey := fmt.Sprintf("%d_%d", conID, ranID)
-       data, exist := c.connections.Get(connectionKey)
-       if exist {
-               connection := data.(*ConnectionInfo)
-               connection.ProtocolBreak = true
-               log.Infof("detected the existing connection: %d-%d is protocol 
break",
-                       conID, ranID)
-       } else {
-               // setting to the protocol break map for encase the runner not 
starting building logs
-               c.connectionProtocolBreakMap.Set(connectionKey, true, 
time.Minute)
-               log.Infof("setting the connection: %d-%d to protocol break 
map", conID, ranID)
-       }
 }
 
 func getSocketPairFromConnectEvent(event events.Event) 
(*events.SocketConnectEvent, *ip.SocketPair) {

Reply via email to