Skip to content
Browse files

Move closeNotify to fix panic with newer golang

This is happening now due to improvements in net/http:

To test, change the go version in the Dockerfile:
+ENV GO_VERSION 1.6beta2

More info here: golang/go#14001

Signed-off-by: Christy Perez <>
  • Loading branch information...
clnperez authored and Aditi Rajagopal committed Jan 18, 2016
1 parent 6b05a59 commit 523156e196308d439c92432dc011c8d6e4910614
Showing with 2 additions and 1 deletion.
  1. +2 −1 api/server/router/build/build_routes.go
@@ -227,10 +227,11 @@ func (br *buildRouter) postBuild(ctx context.Context, w http.ResponseWriter, r *
if closeNotifier, ok := w.(http.CloseNotifier); ok {
finished := make(chan struct{})
defer close(finished)
clientGone := closeNotifier.CloseNotify()
go func() {
select {
case <-finished:
case <-closeNotifier.CloseNotify():
case <-clientGone:
logrus.Infof("Client disconnected, cancelling job: build")

0 comments on commit 523156e

Please sign in to comment.
You can’t perform that action at this time.