Fix a logical race that wasn't detectable by -race -- we were closing a connection that was already reestablished.

This commit is contained in:
Eugene Bujak
2018-11-28 17:55:01 +03:00
parent 4eb122e973
commit e4a3564706
2 changed files with 48 additions and 10 deletions

View File

@@ -28,6 +28,13 @@ func isConnClosed(err error) bool {
// ---------------------
// debug logging helpers
// ---------------------
func _Func() string {
pc := make([]uintptr, 10) // at least 1 entry needed
runtime.Callers(2, pc)
f := runtime.FuncForPC(pc[0])
return path.Base(f.Name())
}
func trace(format string, args ...interface{}) {
pc := make([]uintptr, 10) // at least 1 entry needed
runtime.Callers(2, pc)