Skip to content

Commit bd5f008

Browse files
committed
Merge pull request #4291 from krancour/fix-logspout-deadlock
fix(logspout): fix deadlock when attaching
2 parents a08d433 + 06f301f commit bd5f008

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

logspout/attacher.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ func (m *AttachManager) Listen(source *Source, logstream chan *Log, closer <-cha
122122
if source == nil {
123123
source = new(Source)
124124
}
125-
events := make(chan *AttachEvent)
125+
depth := len(m.attached)
126+
if depth == 0 {
127+
depth = 1
128+
}
129+
events := make(chan *AttachEvent, depth)
126130
m.addListener(events)
127131
defer m.removeListener(events)
128132
for {

0 commit comments

Comments
 (0)