net/http: data race writing to req.Header when serving push #18326
Comments
For a common use case, think ReverseProxy. EDIT: ReverseProxy actually tries to make a copy of the map before modifying it but might have overlooked a |
CL https://golang.org/cl/34493 mentions this issue. |
gopherbot
pushed a commit
to golang/net
that referenced
this issue
Dec 15, 2016
Writing the PUSH_PROMISE can happen concurrently with the request handler, so we should pass the request handler a cloned Header.. Updates golang/go#18326 Change-Id: I918e7ffbc02459b9ede3226f4bd3c56a6a3b350f Reviewed-on: https://go-review.googlesource.com/34493 TryBot-Result: Gobot Gobot <gobot@golang.org> Run-TryBot: Tom Bergan <tombergan@google.com> Reviewed-by: Chris Broadfoot <cbro@golang.org>
CL https://golang.org/cl/34495 mentions this issue. |
CL https://golang.org/cl/34494 mentions this issue. |
gopherbot
pushed a commit
to golang/net
that referenced
this issue
Dec 15, 2016
Updates golang/go#18326 Change-Id: Iaed30073bab10c7fc25132b388d7b2fc101293d5 Reviewed-on: https://go-review.googlesource.com/34494 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
gopherbot
pushed a commit
that referenced
this issue
Dec 15, 2016
Updates bundled x/net/http2 to git rev 1195a05d for: http2: fix incorrect panic https://golang.org/cl/34498 http2: fix race in writePushPromise https://golang.org/cl/34493 http2: speed up TestTransportFlowControl in short mode https://golang.org/cl/33241 http2: don't flush a stream's write queue in sc.resetStream https://golang.org/cl/34238 http2: allow Transport to connect to https://[v6literal]/ without port https://golang.org/cl/34143 http2: log Framer reads and writes when a server test fails https://golang.org/cl/34130 Updates #18326 Updates #18273 Updates #18111 Updates #18248 Updates #18235 Change-Id: I18c7a297fc94d6a843284efcfc43e0fdab9b5f41 Reviewed-on: https://go-review.googlesource.com/34495 Run-TryBot: Chris Broadfoot <cbro@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Should be fixed. |
Confirmed, thanks. |
nimakaviani
added a commit
to cloudfoundry/diego-release
that referenced
this issue
Jun 26, 2017
[finishes #140766303] Submodule src/code.cloudfoundry.org/executor 1a653cd..85f35ea: > update go-loggregator package Submodule src/code.cloudfoundry.org/go-loggregator 0550818..b1525c9: > Fix testhelpers/v1/fakes > Merge pull request #10 from apoydence/split-NewTLSConfig > Ensure all runtime emitters have a default timeout of 10 seconds > Add SendComponentMetric to compatibility client > Fix typo > TestIngressServer uses address instead of port > TestEgressServer needs to save actual address > Removes NewInsecureIngressClient > IngressClient uses addr instead of port > Adds TestEgressServer > Renames TestServer to TestIngressServer > Fix examples > Moves v1 fakes to separate package > Adds egress client wrapper > Renames Option to IngressOption > Renames Client to IngressClient > Adds WithDelta option for EmitCounter > Moves TestServer to testhelpers package > Moves fakes under testhelpers directory > Adds ability to create an insecure client > Add google.golang.org/genproto to vendors > Bump google.golang.org/grpc to v1.4.0 > Export generated loggregator-api files > Fix v2 import in examples/simple > Add v1 compatability for runtime stats emitter > Fix import for runtime_stats example > Move fixtures into example dir > Rename suite_test > Move v2 contents to root directory > Moves generic client and fakes to compatability folder > Use gobindata for feature tests. > Add gomega dependency to scripts/test > Adds another required dependency > Updates go-loggregator test script > Remove go dep tooling and submodule dependencies > Revert "Pin grpc-go using dep and remove dep-ensure script" > Changes runtimeemitter emission interval to 10 seconds > Pin grpc-go using dep and remove dep-ensure script > Add tags to logs, gauges and counters. > Merge branch 'enocom/master' > update Gopkg files > Merge pull request #4 from kdykeman/master > Merge pull request #2 from hdub2/master > Fixes batch interval emission > Adds example for using runtime emitter > Add runtime emitter to emit runtime stats on interval > fix datarace in v2 client test > Update README.md Submodule src/code.cloudfoundry.org/inigo da0693e..f8f80a2: > update go-loggregator package Submodule src/code.cloudfoundry.org/rep ca15821..8fe785b: > emit runtime metrics when using loggregator v2 API Submodule src/code.cloudfoundry.org/volman 64f4d4e..3ee7830: > update go-loggregator package Submodule src/golang.org/x/net c4bb2f7..5f8847a: > dns/dnsmessage: additional test coverage > dns/dnsmessage: allocation free DNS message parsing and building > ipv6: report a destination address on write error > ipv4: report a destination address on write error > icmp: use socket.NativeEndian > ipv6: use socket.NativeEndian > http2: fix Server race > trace: export /debug/requests and /debug/events handlers > http2: make Transport treat http.NoBody like it were nil > publicsuffix: update table to latest list from publicsuffix.org > http2: stop rejecting outgoing paths beginning with two slashes > internal/socket: don't crash with corrupted control messages > bpf: add Setter interface > http2: fix up comment on unexported connError type > ipv6: don't crash with corrupted control messages > ipv4: don't crash with corrupted control messages > ipv6: deflake multicast listener tests > ipv4: deflake multicast listener tests > bpf: fix type of Extension constants > internal/socket: fix 386 emulation on amd64 for FreeBSD > ipv6: add {Read,Write}Batch methods to PacketConn > ipv4: add {Read,Write}Batch methods to {Packet,Raw}Conn > http2: fix nil dereference after Read completes with an error > http2: fix typo in comment > internal/socket: add message IO functionality > internal/socket: add platform-dependent boilerplate files > nettest: skip testConcurrentMethods on Plan 9 > http2/hpack: gofmt -w -s > internal/iana: update DSCP names > Revert "ipv4, ipv6, internal/netreflect, bpf: fix the x/net build" > internal/socket: merge internal/netreflect into internal/socket package > ipv6: plumb in the standard library of Go 1.9 by using internal/socket package > ipv4: plumb in the standard library of Go 1.9 by using internal/socket package > internal/socket: new package > http2: fix RFC number typo in comment > http2: remove extra goroutine stack from awaitGracefulShutdown > http2: Discard DATA frames from the server after the response body is closed > http2: mostly test for Transport memory issue > http2/hpack: remove unused pair function from package > http2/hpack: remove pair function and initialize directly > http2: fix style inconsistency in test > http2: reduce the number of select cases in serverConn.server > http2: fix lock contention slowdown due to gracefulShutdownCh > http2/hpack: move initialization to a static table > lif: rename internal types > http2: add all bad ciphers, use package constants > xsrftoken: panic for unsafe zero length keys > route: don't fail test when at least one version of INET protocols is available > lif: don't fail test when at least one version of INET protocols is available > trace: support Go 1.6 again > nettest: break on unexpected error > trace: use standard library context > http2: Use NO_ERROR instead of CANCEL when responding before the request is finished > http2: enforce write deadline per stream > http2/h2demo: don't auto redirect the HTTP-only serverpush demo to HTTPS > http2/hpack: fix memory leak in headerFieldTable lookup maps > http2/h2demo: use HTTP host for HTTP-only link > http2/h2demo: add demo for HTTP/2 Server Push > Revert "http2/h2demo: add HTTP/2 with Server Push" > idna: copy the idna package from x/text, take 2. > http2/h2demo: add HTTP/2 with Server Push > http2: work around Go 1.8 tls.Config.Clone bug > lif: use of nativeEndian to make API endian agnostic > dns/dnsmessage: add support for parsing and packing of DNS messages > http2: add configurable knobs for the server's receive window > http2/hpack: speedup Encoder.searchTable > http2: Add opt-in option to Framer to allow DataFrame struct reuse > http2: replace fixedBuffer with dataBuffer > http2/hpack: remove hpack's constant time string comparison > ipv4, ipv6, internal/netreflect, bpf: fix the x/net build > route: drop support for go1.5 > lif: drop support for go1.5 > internal/netreflect: don't build on go1.9 or above > publicsuffix: update table to latest list from publicsuffix.org > proxy: split SOCKS5 Dial method in two > context/ctxhttp: close httptest server > internal/netreflect: fix test on NaCl and Plan 9 > route: fix typo > route: add support for the manipulation of routing informaion > http2: don't allow writing non-zero padding unless Framer.AllowIllegalWrites > all: single space after period > idna: Revert "use code generated by internal x/text package" > bpf: implement fmt.Stringer for BPF instructions > trace: initialize templates lazily > ipv4: simplify init function for darwin > internal/netreflect: more use of internal/nettest package > internal/nettest: add missing support for "unixgram" to TestableNetwork > http2: nit in TestServer_Push_StateTransitions > http2: fix flake in TestServer_Push_StateTransitions > internal/nettest: add TestableNetwork, NewLocalListener and NewLocalPacketListener > nettest: use of internal/nettest package > http2/h2i: strip port from server name in client hello > internal/netreflect: use of internal/nettest package > http2/h2i: send RequestURI as path, to not lose query args > x/net/bpf: cleanup TestAsmDisasm > http2: fix nits found by vet > bpf: disasm load extension to type LoadExtension > bpf: disasm "fake" jump conditions > ipv6: add missing BUGS section for Windows > ipv4: drop package name prefix from identifiers in docs for consistency > ipv6: drop package name prefix from identifiers in docs for consistency > idna: use code generated by internal x/text package > http2: remove unnecessary TODO for trailer keys allocation > http2: clear WriteTimeout in Server > http2: fix typo > http2: fix incorrect panic > http2: add regression test for issue golang/go#18326 > http2: fix race in writePushPromise > icmp: add missing BUGS section > ipv6: add missing BUGS section > ipv4: add missing BUGS section > context: deflake tests under Go 1.6 > http2: speed up TestTransportFlowControl in short mode > http2: don't flush a stream's write queue in sc.resetStream > http2: allow Transport to connect to https://[v6literal]/ without port > http2: log Framer reads and writes when a server test fails > ipv4: deflake TestConnUnicastSocketOptions on Windows > ipv4: add missing IP_HDRINCL option on Windows > nettest: update comment on MakePipe > ipv6: add support for linux/{mips,mipsle} > ipv4: add support for linux/{mips,mipsle} > http2: make Transport retry on server's GOAWAY graceful shutdown > http2: fix minor stream accounting bug > http2: test for retry after GOAWAY > nettest: add package to test for networking conformance > websocket: mention the gorilla package > ipv6: don't fail test on IPv6 disabled kernel > ipv6: simplify references to RFCs in package documentation > ipv6: document that package ipv6 doesn't support Darwin kernel version 12 or below > internal/nettest: make SupportsIPv6 return false on Darwin kernel version 12 or below > http2: fix a typo > http2: don't crash when writing RST_STREAM on idle or closed streams > trace: remove internal Google reference from comment > webdav: gofmt -w -s > http2: schedule RSTStream writes onto its stream's queue > http2/h2demo: use Let's Encrypt for the TLS cert > http2: make Server respect http1 Server's SetKeepAlivesEnabled > Revert "ipv6: disable multicast packet delivery tests on darwin 12 or below" > ipv6: disable multicast packet delivery tests on darwin 12 or below > http2: conditionally log stacks from panics in Server Handlers like net/http > http2: fix CloseNotify data race > http2: don't overflow stream IDs in server push > http2: fix racey and flaky server push test > http2: disable server push on receiving a GOAWAY > all: make copyright headers consistent with one space after period > http2: fix state tracking for pushed streams > Revert "context: use Go 1.8 type alias for CancelFunc and Context" > http2: fix over-aggressive ignoring of frames while in "go away" mode > http2: fix Transport race sending RST_STREAM while reading DATA on cancels > http2: remove h2-14 ALPN proto > webdav: add Context argument to FileSystem interface > http2: make http2.Server access http1's Server via an interface check > http2/h2i: do not assume that stdin value is always 0 > http2: add support for graceful shutdown of Server > webdav: fix recently-broken tests > http2: change how Server.IdleTimeout is initialized from http.Server > http2/h2i: update line endings for recent change to console package > webdav: have escapeXML perform fewer allocations. > context: use Go 1.8 type alias for CancelFunc and Context > http2: initialize Server.IdleTimeout from http.Server as http1 does > http2: fix optimized write scheduling > http2: implement support for server push > http2: reject stream self-dependencies > http2: optimize server frame writes > http2: interface to support pluggable schedulers > publicsuffix: update table to latest list from publicsuffix.org > http2: add Server.IdleTimeout > webdav: escape displayname > http2: make Server return conn protocol errors on bad idle stream frames > http2: fix Server race with concurrent Read/Close > ipv6: remove unnecessary control message marshaling > ipv4: remove unnecessary control message marshaling > http2: make Server reuse 64k request body buffer between requests > http2: never Read from Request.Body in Transport to determine ContentLength > websocket: drop support for go1.4 or below > websocket: use of crypto/rand package in test > ipv6: drop support for go1.4 or below > ipv4: drop support for go1.4 or below > websocket: limit incoming payload size > ipv4: add support for FreeBSD 11 > trace: don't allocate all events upfront > Revert "trace: don't allocate all events upfront" > lif: rename internal types and constants generated by cgo > ipv6: rename internal types and constants generated by cgo > ipv4: rename internal types and constants generated by cgo > trace: don't allocate all events upfront > ipv6: don't refer to cgo-generated union field > ipv4: don't refer to cgo-generated union field > ipv6: add support for solaris > ipv4: add support for solaris > ipv6: rename thunk_linux_386.s to sys_linux_386.s > ipv4: rename thunk_linux_386.s to sys_linux_386.s > http2: remove duplicate map lookups in checkConnHeaders > websocket: use net.Dialer to open tcp connection > http2: mention bogus header value in error messages > trace: spelling consistency tweaks > http2: don't sniff Request.Body on 100-continue requests in Transport > http2: in Server, disarm connection's ReadTimeout after first request > http2: add Transport support for IdleConnTimeout > http: fix build on Go 1.6 and below > http2: implement Ping method on ClientConn > x/net/http2: use request url scheme > lif: new package > route: fix typo > ipv4: fix typo > ipv6: fix typo > route: test helper code cleanup > http2: fix broken tests > x/net/http2: Fix various typos in doc comments. > ipv6: simplify init function for darwin > internel/nettest: add SupportsIPv6MulticastDeliveryOnLoopback > http2: don't sniff first Request.Body byte in Transport until we have a conn > http2: add Transport support for unicode domain names > http2: fix bug where '*' as a valid :path value in Transport > icmp: don't step on recycled socket descriptors > net: skip tests on OS X 10.8 to avoid a kernel panic > http2: fix all vet warnings > internal/netreflect: fix test on nacl, plan9 and windows > ipv6: deduplicate socket option code > ipv4: deduplicate socket option code > ipv6: use of internal/netreflect package > ipv4: use of internal/netreflect package > internal/netreflect: new package > http2: don't send bogus :path pseudo headers if Request.URL.Opaque is set > http2: fix protocol violation regression when writing certain request bodies > publicsuffix: update table to latest list from publicsuffix.org > http2: adjust flow control on open streams when processing SETTINGS > http2: add missing import path declaration > http2: add more Transport logging around why connections close > http2: fix Transport.RoundTrip hang on stream error before headers > http2: add more HEADERS and error logging in GODEBUG=http2debug=2 mode > http2: make Transport work around mod_h2 bug > http2: don't ignore DATA padding in flow control > http2: return flow control for closed streams > http2: fix data race on cc.singleUse > route: don't crash or hang up with corrupted messages > http2: make Transport prefer HTTP response header recv before body write error > http2: make Transport treat "Connection: close" the same as Request.Close > context/ctxhttp: if context is canceled, return its error > http2: fix flaky TestTransportResPattern_* tests > http2: make Transport honor Request.Close more aggressively > http2: fix flaky TestTransportReqBodyAfterResponse_403 > context/ctxhttp: add a specialized minimal version for Go 1.7 > publicsuffix: update table to latest list from publicsuffix.org. > http2: add additional blacklisted ciphersuites > http2: merge multiple GOAWAY frames' contents into error message > http2: make Transport return server's GOAWAY error back to the user > webdav: skip test that fails with gccgo > ipv4: add support for ppc (using gccgo) > ipv6: add support for ppc (using gccgo) > http2: fix typo in ReadFrame > bpf: implement LoadExtension and ExtLen for VM > bpf: fix a typo > bpf: add Go implementation of virtual machine > webdav: respect the Handler.Prefix in confirmLocks. > publicsuffix: strip generated comments; automatically scrape git version. > http2: fix data race on pipe > http2: consider buffered data when doing stream flow control > http2: GotFirstResponseByte hook should only fire once > websocket: fix Read behaviour in hybiFrameReader.Read > webdav: set 'getlastmodified' live property for directories > http2: fix nits in test > http2: allow http scheme for http2 > http2: prevent Server from sending status 100 header after anything else > http2: let handlers close Request.Body without killing streams > http2: fix Transport.CloseIdleConnections when http1+http2 are wired together > http2: delay sending request body in Transport if 100-continue is set > http2, lex/httplex: make Transport reject bogus headers before sending > http2: reject more trailer values > http2: with Go 1.7 set Request.Context in ServeHTTP handlers > http2: when using Go 1.7, make Transport use httptrace hooks > ipv6: add support for linux/s390x > ipv4: add support for linux/s390x > route: fix typos in test > ipv6: support attaching packet filters to PacketConn. > ipv4: support attaching packet filters to PacketConn/RawConn. > route: new package > http2/hpack: forbid excess and invalid padding in hpack decoder > http2: make Transport use Request.Context, set Response.Uncompressed > context: correct spelling of TODO in comment > ipv4: don't fail test on big endian machine > icmp: don't fail test on big endian machine > net/trace: fix comment typo > context: fix doc typo > http2: allow StreamDep of 0 in HEADERS and PRIORITY frames > http2: delete pre-Go1.5 request cancellation > context/ctxhttp: remove pre-Go 1.5 support > context: bump gccgo-specific alloc limit for WithTimeout test. > http2: standardize RFC mention format > ipv6: fix a typo > ipv4: fix a typo > icmp: fix a typo > http2: fix typos > http2/hpack: fix a typo > webdav: have the exported API use the standard library's xml.Name type. > webdav: rename the "etc/internal/xml" import. > webdav: run "gofmt -s" to simplify some tests. > webdav: fill in the package's doc comment. > webdav: remove runtime check for Go 1.4 or earlier. > http2: make Server reject connection-level headers with a 400 response > websocket: remove redundant error handling > context: implement in terms of the standard library for Go 1.7+ > http2: Ignore Keep-Alive header in requests > bpf: rename LoadIPv4HeaderLen to the more generic LoadMemShift. Submodule src/golang.org/x/text 0000000...4e9ab9e (new submodule) Signed-off-by: Chris Piraino <cpiraino@pivotal.io>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?go version go1.8beta1 darwin/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
Modified the
req.Header
map from a Handler invoked by Push.https://play.golang.org/p/3azPpVRX8f
What did you see instead?
The text was updated successfully, but these errors were encountered: