cmd/coordinator: use Request.Context in handleLogs

CloseNotify has been deprecated in favor of Request.Context.
Start using the newer API to avoid the panic when CloseNotify
gets called too late.

Fixes golang/go#44244.

Change-Id: I1f01c2d42cf6735d1161b977b62a7d982e8a61ea
Reviewed-on: https://go-review.googlesource.com/c/build/+/291769
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
This commit is contained in:
Dmitri Shuralyov 2021-02-12 19:33:27 -05:00
Родитель d576fd36a7
Коммит dc2c694133
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -810,7 +810,7 @@ func handleLogs(w http.ResponseWriter, r *http.Request) {
output := st.output.Reader()
go func() {
<-w.(http.CloseNotifier).CloseNotify()
<-r.Context().Done()
output.Close()
}()
buf := make([]byte, 65536)