Skip to content

Commit

Permalink
Merge pull request kubearmor#624 from nyrahul/main
Browse files Browse the repository at this point in the history
feeder: solved deadlock issue with telemetry
  • Loading branch information
nyrahul authored Feb 16, 2022
2 parents bf39613 + 2a27439 commit 975ab49
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions KubeArmor/feeder/feeder.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func (ls *LogService) WatchLogs(req *pb.RequestMessage, svr pb.LogService_WatchL
case codes.OK:
// noop
case codes.Unavailable, codes.Canceled, codes.DeadlineExceeded:
kg.Warnf("Failed to send a log=[%+v] err=[%s]", resp, status.Err().Error())
kg.Warnf("Failed to send a log=[%+v] err=[%s] CODE=%d", resp, status.Err().Error(), status.Code())
return status.Err()
default:
return nil
Expand Down Expand Up @@ -497,8 +497,8 @@ func (fd *Feeder) PushMessage(level, message string) {
pbMsg.Level = level
pbMsg.Message = message

MsgLock.Lock()
defer MsgLock.Unlock()
// MsgLock.Lock()
// defer MsgLock.Unlock()

for uid := range MsgStructs {
MsgStructs[uid].Broadcast <- &pbMsg
Expand Down Expand Up @@ -587,8 +587,8 @@ func (fd *Feeder) PushLog(log tp.Log) {

pbAlert.Result = log.Result

AlertLock.Lock()
defer AlertLock.Unlock()
// AlertLock.Lock()
// defer AlertLock.Unlock()

for uid := range AlertStructs {
AlertStructs[uid].Broadcast <- &pbAlert
Expand Down Expand Up @@ -624,8 +624,8 @@ func (fd *Feeder) PushLog(log tp.Log) {

pbLog.Result = log.Result

LogLock.Lock()
defer LogLock.Unlock()
// LogLock.Lock()
// defer LogLock.Unlock()

for uid := range LogStructs {
LogStructs[uid].Broadcast <- &pbLog
Expand Down

0 comments on commit 975ab49

Please sign in to comment.