Skip to content

Commit

Permalink
fix(controller): add lock for listsegment func
Browse files Browse the repository at this point in the history
Signed-off-by: jyjiangkai <jyjiangkai@163.com>
  • Loading branch information
hwjiangkai committed Feb 8, 2023
1 parent 1b4e82a commit a7c2e7b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/controller/eventbus/eventlog/eventlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ func (mgr *eventlogManager) GetEventLogSegmentList(elID vanus.ID) []*Segment {
return result
}
el, _ := v.(*eventlog)
mgr.mutex.Lock()
defer mgr.mutex.Unlock()
s := el.head()
for s != nil {
result = append(result, s)
Expand Down

0 comments on commit a7c2e7b

Please sign in to comment.