From e645bbf89890fbf93251a1432dad678746bcec6c Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Mon, 6 Jul 2015 06:46:14 +1000 Subject: [PATCH] playground/socket: make output/end race less likely This doesn't fix the race; doing that would require a bit of a redesign. Since GopherCon is this week, just put in this stop-gap measure for now. Update golang/go#11534 Change-Id: Ied6c5dd52778534a7a08b5ba3fa15c0352a65646 Reviewed-on: https://go-review.googlesource.com/11886 Reviewed-by: Josh Bleecher Snyder --- playground/socket/socket.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playground/socket/socket.go b/playground/socket/socket.go index 6905d0c2..76527aee 100644 --- a/playground/socket/socket.go +++ b/playground/socket/socket.go @@ -316,7 +316,7 @@ func (p *process) end(err error) { m.Body = err.Error() } // Wait for any outstanding reads to finish (potential race here). - time.AfterFunc(msgDelay, func() { p.out <- m }) + time.AfterFunc(4*msgDelay, func() { p.out <- m }) } // cmd builds an *exec.Cmd that writes its standard output and error to the