go-libvirt icon indicating copy to clipboard operation
go-libvirt copied to clipboard

Deadlock if Stream Shutdown races with Push

Open multippt opened this issue 1 year ago • 0 comments

There's a deadlock scenario if the stream is being shutdown while still receiving events, which can occur if using LifecycleEvents and cancelling the context.

Example reproduction case

func TestStreamShutdown(t *testing.T) {
	s := NewStream(1, 2)
	events := testEvents(1)
	s.Shutdown()
	s.Push(events[0])
}

multippt avatar Apr 13 '23 08:04 multippt