Skip to content

Commit

Permalink
Fix concurrent map operation in the access log module
Browse files Browse the repository at this point in the history
  • Loading branch information
mrproliu committed Jun 17, 2024
1 parent 393fa59 commit 2a22542
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Release Notes.
* Fixed the issue where `conntrack` could not find the Reply IP in the access log module.
* Fix errors when compiling C source files into eBPF bytecode on a system with Linux headers version 6.2 or higher.
* Fixed `ip_list_rcv` probe is not exist in older linux kernel.
* Fix concurrent map operation in the access log module.

#### Documentation

Expand Down
4 changes: 3 additions & 1 deletion pkg/accesslog/common/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,8 @@ func (c *ConnectionManager) AddNewProcess(pid int32, entities []api.ProcessInter
}

func (c *ConnectionManager) rebuildLocalIPWithPID() {
c.monitoringProcessLock.RLock()
defer c.monitoringProcessLock.RUnlock()
result := make(map[string]int32)
for pid, entities := range c.monitoringProcesses {
for _, entity := range entities {
Expand Down Expand Up @@ -575,7 +577,7 @@ func (c *ConnectionManager) OnBuildConnectionLogFinished() {
return
}
// already mark as deletable or process not monitoring
shouldDelete := con.MarkDeletable || len(c.monitoringProcesses[int32(con.PID)]) == 0
shouldDelete := con.MarkDeletable || !c.ProcessIsMonitor(con.PID)

if shouldDelete {
deletableConnections = append(deletableConnections, key)
Expand Down

0 comments on commit 2a22542

Please sign in to comment.