소스 검색

Fix race condition in JSONFileLogger.Log

Signed-off-by: Ingo Gottwald <in.gottwald@gmail.com>
Ingo Gottwald 9 년 전
부모
커밋
f8c5420080
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      daemon/logger/jsonfilelog/jsonfilelog.go

+ 2 - 0
daemon/logger/jsonfilelog/jsonfilelog.go

@@ -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,