Skip to content

Commit 2a22542

Browse files
committed
Fix concurrent map operation in the access log module
1 parent 393fa59 commit 2a22542

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Release Notes.
1212
* Fixed the issue where `conntrack` could not find the Reply IP in the access log module.
1313
* Fix errors when compiling C source files into eBPF bytecode on a system with Linux headers version 6.2 or higher.
1414
* Fixed `ip_list_rcv` probe is not exist in older linux kernel.
15+
* Fix concurrent map operation in the access log module.
1516

1617
#### Documentation
1718

pkg/accesslog/common/connection.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,8 @@ func (c *ConnectionManager) AddNewProcess(pid int32, entities []api.ProcessInter
447447
}
448448

449449
func (c *ConnectionManager) rebuildLocalIPWithPID() {
450+
c.monitoringProcessLock.RLock()
451+
defer c.monitoringProcessLock.RUnlock()
450452
result := make(map[string]int32)
451453
for pid, entities := range c.monitoringProcesses {
452454
for _, entity := range entities {
@@ -575,7 +577,7 @@ func (c *ConnectionManager) OnBuildConnectionLogFinished() {
575577
return
576578
}
577579
// already mark as deletable or process not monitoring
578-
shouldDelete := con.MarkDeletable || len(c.monitoringProcesses[int32(con.PID)]) == 0
580+
shouldDelete := con.MarkDeletable || !c.ProcessIsMonitor(con.PID)
579581

580582
if shouldDelete {
581583
deletableConnections = append(deletableConnections, key)

0 commit comments

Comments
 (0)