Skip to content

Commit

Permalink
log: do not deadlock on failed symlink
Browse files Browse the repository at this point in the history
Seen in #9933, though the issue there (failure to creating the symlink)
is not addressed here.
  • Loading branch information
tbg committed Oct 13, 2016
1 parent d7bb465 commit ed6a100
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/util/log/clog.go
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ func (l *loggingT) putBuffer(b *buffer) {
// the data to the log files. If a trace location is set, stack traces
// are added to the entry before marshaling.
func (l *loggingT) outputLogEntry(s Severity, file string, line int, msg string) {
// TODO(tschottdorf): this is a pretty horrible critical section.
l.mu.Lock()

// Set additional details in log entry.
Expand Down Expand Up @@ -727,7 +728,9 @@ func (l *loggingT) outputLogEntry(s Severity, file string, line int, msg string)
if err := l.createFiles(s); err != nil {
// Make sure the message appears somewhere.
l.outputToStderr(entry, stacks)
l.mu.Unlock()
l.exit(err)
return
}
}

Expand Down

0 comments on commit ed6a100

Please sign in to comment.