toxiproxy icon indicating copy to clipboard operation
toxiproxy copied to clipboard

Deadlock on writing last buffer to dead output

Open miry opened this issue 3 years ago • 0 comments

It happen that during removing the Toxic deadlock appeared.

Log message on deadlock:

toxiproxy         | time="2019-12-06T21:01:03Z" level="warning" msg="Destination terminated" err=readfrom tcp 172.19.0.7:19092->172.19.0.8:60432: write tcp 172.19.0.7:19092->172.19.0.8:60432: write: broken pipe name="kafka-1" bytes=4423219

Toxiproxy v2.4.0:

		interrupted := false
		stopped := false
		for !interrupted {
			select {
			case interrupted = <-stop:
				stopped = true
			case tmp := <-link.stubs[i].Input:
				if tmp == nil {
					link.stubs[i].Close()
					if !stopped {
						<-stop
					}
					return
				}
                          ->    link.stubs[i].Output <- tmp
			}
		}

miry avatar Sep 02 '22 09:09 miry