This is an automated email from the ASF dual-hosted git repository.
liuhan pushed a commit to branch tmp_disable_reading
in repository https://gitbox.apache.org/repos/asf/skywalking-rover.git
The following commit(s) were added to refs/heads/tmp_disable_reading by this
push:
new 7a9802d delete connection by detection
7a9802d is described below
commit 7a9802d949b819fdb7e093612d5af3aab49d1cf9
Author: mrproliu <[email protected]>
AuthorDate: Thu Dec 19 17:45:39 2024 +0800
delete connection by detection
---
pkg/accesslog/collector/protocols/queue.go | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/pkg/accesslog/collector/protocols/queue.go
b/pkg/accesslog/collector/protocols/queue.go
index 2cd2035..c38cc7b 100644
--- a/pkg/accesslog/collector/protocols/queue.go
+++ b/pkg/accesslog/collector/protocols/queue.go
@@ -175,7 +175,6 @@ func (p *PartitionContext) OnConnectionClose(event
*events.SocketCloseEvent, clo
}
connection := conn.(*PartitionConnection)
connection.closeCallback = closeCallback
- connection.closed = true
log.Debugf("receive the connection close event and mark is closable,
connection ID: %d, random ID: %d, partition number: %d",
event.GetConnectionID(), event.GetRandomID(), p.partitionNum)
}
@@ -313,10 +312,19 @@ func (p *PartitionContext) processEvents() {
}
}
+func timeToStr(t time.Time) string {
+ if t.IsZero() {
+ return ""
+ }
+ return t.Format("2006-01-02 15:04:05")
+}
+
func (p *PartitionContext) checkTheConnectionIsAlreadyClose(con
*PartitionConnection) {
if time.Since(con.lastCheckCloseTime) <= time.Second*30 {
return
}
+ log.Infof("checking the connection is closed or not, connection ID: %d,
random ID: %d, current: %s, last check: %s",
+ con.connectionID, con.randomID, timeToStr(time.Now()),
timeToStr(con.lastCheckCloseTime))
con.lastCheckCloseTime = time.Now()
var activateConn common.ActiveConnection
if err := p.context.BPF.ActiveConnectionMap.Lookup(con.connectionID,
&activateConn); err != nil {