Skip to content

Commit 99bdecf

Browse files
committed
Fix wrong lock location
1 parent 2a22542 commit 99bdecf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/accesslog/common/connection.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,6 @@ 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()
452450
result := make(map[string]int32)
453451
for pid, entities := range c.monitoringProcesses {
454452
for _, entity := range entities {
@@ -527,6 +525,8 @@ func (c *ConnectionManager) RecheckAllProcesses(processes map[int32][]api.Proces
527525
processInBPF[int32(pid)] = true
528526
}
529527

528+
c.monitoringProcessLock.RLock()
529+
defer c.monitoringProcessLock.RUnlock()
530530
// make sure BPF and user space are consistent
531531
for pid := range processInBPF {
532532
if _, ok := c.monitoringProcesses[pid]; !ok {

0 commit comments

Comments
 (0)