Merge pull request #535 from iamqizhao/master
Close ServerTransport instead of the raw connection
This commit is contained in:
@ -279,7 +279,7 @@ func (s *Server) serveNewHTTP2Transport(c net.Conn, authInfo credentials.AuthInf
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !s.addConn(st) {
|
if !s.addConn(st) {
|
||||||
c.Close()
|
st.Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
s.serveStreams(st)
|
s.serveStreams(st)
|
||||||
|
@ -1354,8 +1354,6 @@ func interestingGoroutines() (gs []string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var failOnLeaks = flag.Bool("fail_on_leaks", false, "Fail tests if goroutines leak.")
|
|
||||||
|
|
||||||
// leakCheck snapshots the currently-running goroutines and returns a
|
// leakCheck snapshots the currently-running goroutines and returns a
|
||||||
// function to be run at the end of tests to see whether any
|
// function to be run at the end of tests to see whether any
|
||||||
// goroutines leaked.
|
// goroutines leaked.
|
||||||
@ -1364,10 +1362,6 @@ func leakCheck(t testing.TB) func() {
|
|||||||
for _, g := range interestingGoroutines() {
|
for _, g := range interestingGoroutines() {
|
||||||
orig[g] = true
|
orig[g] = true
|
||||||
}
|
}
|
||||||
leakf := t.Logf
|
|
||||||
if *failOnLeaks {
|
|
||||||
leakf = t.Errorf
|
|
||||||
}
|
|
||||||
return func() {
|
return func() {
|
||||||
// Loop, waiting for goroutines to shut down.
|
// Loop, waiting for goroutines to shut down.
|
||||||
// Wait up to 5 seconds, but finish as quickly as possible.
|
// Wait up to 5 seconds, but finish as quickly as possible.
|
||||||
@ -1387,7 +1381,7 @@ func leakCheck(t testing.TB) func() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for _, g := range leaked {
|
for _, g := range leaked {
|
||||||
leakf("Leaked goroutine: %v", g)
|
t.Errorf("Leaked goroutine: %v", g)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user