Fix race condition in JSONFileLogger.Log
Signed-off-by: Ingo Gottwald <in.gottwald@gmail.com> Upstream-commit: f8c54200805a9b9088c90f0b46bfa848d7bae67c Component: engine
This commit is contained in:
@@ -90,6 +90,8 @@ func (l *JSONFileLogger) Log(msg *logger.Message) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
l.mu.Lock()
|
||||
defer l.mu.Unlock()
|
||||
err = (&jsonlog.JSONLogs{
|
||||
Log: append(msg.Line, '\n'),
|
||||
Stream: msg.Source,
|
||||
|
||||
Reference in New Issue
Block a user