2
0
mirror of https://github.com/soheilhy/cmux.git synced 2025-10-23 14:56:29 +08:00

Tweak shutdown behaviour (again)

The previous behaviour was unsound, as it was prone to dropping
connections under (temporary) high load. The new behaviour requires that
users are well-behaved with respect to shutdown - the root listener
must be shut down before any of the child listeners are, otherwise
deadlocks may occur. This requirement seems reasonable.
This commit is contained in:
Tamir Duberstein
2016-02-23 11:29:57 -05:00
parent 2625710699
commit f8697fe264
3 changed files with 42 additions and 28 deletions

View File

@@ -32,7 +32,6 @@ func BenchmarkCMuxConn(b *testing.B) {
}
}()
donec := make(chan struct{})
var wg sync.WaitGroup
wg.Add(b.N)
@@ -41,6 +40,6 @@ func BenchmarkCMuxConn(b *testing.B) {
c := &mockConn{
r: bytes.NewReader(benchHTTPPayload),
}
m.serve(c, donec, &wg)
m.serve(c, &wg)
}
}