Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http/httputil: TestReverseProxyCancellation fails on Plan 9 #9554

Closed
0intro opened this issue Jan 9, 2015 · 7 comments

Comments

Projects
None yet
4 participants
@0intro
Copy link
Member

commented Jan 9, 2015

What steps will reproduce the problem?

% cd /usr/go/src/net/http/httputil
% go test -run TestReverseProxyCancellation
--- FAIL: TestReverseProxyCancellation (10.17s)
    reverseproxy_test.go:227: Failed to close backend connection
    reverseproxy_test.go:261: Non-nil response
FAIL
exit status: 'httputil.test 3001559: 1'
FAIL    net/http/httputil   10.239s

What is the expected output? What do you see instead?

The test is failing because closing the TCP connection via CancelRequest()
doesn't wake up the readers.

This is related to issues #7237, #7782 and #8908.

@0intro 0intro self-assigned this Jan 9, 2015

@bradfitz

This comment has been minimized.

Copy link
Member

commented Jan 9, 2015

I noticed this too. So you're sure it's the same issue as the TCP-wake-up-Readers issue? It's not just the manual 10 second timeout being too slow for Plan9-on-GCE?

@0intro

This comment has been minimized.

Copy link
Member Author

commented Jan 10, 2015

Yes, the reader goroutine is stuck after the close. It's not related to GCE.

@0intro

This comment has been minimized.

Copy link
Member Author

commented Jan 10, 2015

Here is the stack trace:

cpu% go test -run TestReverseProxyCancellation
goroutine 19 [running]:
net/http/httputil.func·015(0x304b0138, 0x104aec80, 0x10502310)
    /usr/go/src/net/http/httputil/reverseproxy_test.go:232 +0x21d
net/http.HandlerFunc.ServeHTTP(0x104b0010, 0x304b0138, 0x104aec80, 0x10502310)
    /usr/go/src/net/http/server.go:1322 +0x3a
net/http/httptest.(*waitGroupHandler).ServeHTTP(0x104b0630, 0x304b0138, 0x104aec80, 0x10502310)
    /usr/go/src/net/http/httptest/server.go:200 +0xa4
net/http.serverHandler.ServeHTTP(0x104f6240, 0x304b0138, 0x104aec80, 0x10502310)
    /usr/go/src/net/http/server.go:1760 +0x144
net/http.(*conn).serve(0x104fe3c0)
    /usr/go/src/net/http/server.go:1261 +0xa17
created by net/http.(*Server).Serve
    /usr/go/src/net/http/server.go:1808 +0x303

goroutine 1 [chan receive]:
testing.RunTests(0x2c2df4, 0x380b00, 0x7, 0x7, 0x1)
    /usr/go/src/testing/testing.go:556 +0x8bb
testing.(*M).Run(0x104de1e0, 0x38f9c0)
    /usr/go/src/testing/testing.go:485 +0x5d
main.main()
    net/http/httputil/_test/_testmain.go:64 +0x176

goroutine 6 [select]:
net/http.(*persistConn).roundTrip(0x104fe060, 0x104c04a8, 0x0, 0x0, 0x0)
    /usr/go/src/net/http/transport.go:1086 +0x748
net/http.(*Transport).RoundTrip(0x105021c0, 0x10502070, 0xaaefa, 0x0, 0x0)
    /usr/go/src/net/http/transport.go:235 +0x42c
net/http.send(0x10502070, 0x304af8f0, 0x105021c0, 0x16, 0x0, 0x0)
    /usr/go/src/net/http/client.go:220 +0x3b7
net/http.(*Client).send(0x382730, 0x10502070, 0x16, 0x0, 0x0)
    /usr/go/src/net/http/client.go:143 +0xf7
net/http.(*Client).doFollowingRedirects(0x382730, 0x10502070, 0x2c2e7c, 0x0, 0x0, 0x0)
    /usr/go/src/net/http/client.go:374 +0x9d1
net/http.(*Client).Do(0x382730, 0x10502070, 0x104dcd60, 0x0, 0x0)
    /usr/go/src/net/http/client.go:175 +0x8a
net/http/httputil.TestReverseProxyCancellation(0x104fe420)
    /usr/go/src/net/http/httputil/reverseproxy_test.go:264 +0x525
testing.tRunner(0x104fe420, 0x380b48)
    /usr/go/src/testing/testing.go:447 +0xb6
created by testing.RunTests
    /usr/go/src/testing/testing.go:555 +0x881

goroutine 7 [syscall]:
syscall.Syscall(0x104dd2c0, 0x0, 0x0, 0x0, 0x0, 0x7, 0xa, 0x1)
    /usr/go/src/syscall/asm_plan9_386.s:22 +0x5
syscall.Open(0x104dd2a0, 0x11, 0x0, 0x0, 0x0, 0x0)
    /usr/go/src/syscall/zsyscall_plan9_386.go:70 +0x88
os.OpenFile(0x104dd2a0, 0x11, 0x0, 0x0, 0x1053ddd4, 0x0, 0x0)
    /usr/go/src/os/file_plan9.go:111 +0x36a
os.Open(0x104dd2a0, 0x11, 0x248c88, 0x0, 0x0)
    /usr/go/src/os/file.go:245 +0x4f
net.(*netFD).acceptPlan9(0x104f6200, 0x0, 0x0, 0x0)
    /usr/go/src/net/ipsock_plan9.go:205 +0x15e
net.(*TCPListener).AcceptTCP(0x104c03e0, 0xffffffff, 0x0, 0x0)
    /usr/go/src/net/tcpsock_plan9.go:126 +0x5e
net.(*TCPListener).Accept(0x104c03e0, 0x0, 0x0, 0x0, 0x0)
    /usr/go/src/net/tcpsock_plan9.go:139 +0x6c
net/http/httptest.(*historyListener).Accept(0x104dcc00, 0x0, 0x0, 0x0, 0x0)
    /usr/go/src/net/http/httptest/server.go:48 +0x5d
net/http.(*Server).Serve(0x104f6240, 0x304afb48, 0x104dcc00, 0x0, 0x0)
    /usr/go/src/net/http/server.go:1785 +0x8d
created by net/http/httptest.(*Server).Start
    /usr/go/src/net/http/httptest/server.go:109 +0x2a8

goroutine 8 [syscall]:
syscall.Syscall(0x104dd0e0, 0x0, 0x0, 0x0, 0x0, 0x7, 0xa, 0x1)
    /usr/go/src/syscall/asm_plan9_386.s:22 +0x5
syscall.Open(0x104dd0c0, 0x11, 0x0, 0x0, 0x0, 0x0)
    /usr/go/src/syscall/zsyscall_plan9_386.go:70 +0x88
os.OpenFile(0x104dd0c0, 0x11, 0x0, 0x0, 0x104b9dd4, 0x0, 0x0)
    /usr/go/src/os/file_plan9.go:111 +0x36a
os.Open(0x104dd0c0, 0x11, 0x248c88, 0x0, 0x0)
    /usr/go/src/os/file.go:245 +0x4f
net.(*netFD).acceptPlan9(0x104f6300, 0x0, 0x0, 0x0)
    /usr/go/src/net/ipsock_plan9.go:205 +0x15e
net.(*TCPListener).AcceptTCP(0x104c0478, 0xffffffff, 0x0, 0x0)
    /usr/go/src/net/tcpsock_plan9.go:126 +0x5e
net.(*TCPListener).Accept(0x104c0478, 0x0, 0x0, 0x0, 0x0)
    /usr/go/src/net/tcpsock_plan9.go:139 +0x6c
net/http/httptest.(*historyListener).Accept(0x104dcd40, 0x0, 0x0, 0x0, 0x0)
    /usr/go/src/net/http/httptest/server.go:48 +0x5d
net/http.(*Server).Serve(0x104f6380, 0x304afb48, 0x104dcd40, 0x0, 0x0)
    /usr/go/src/net/http/server.go:1785 +0x8d
created by net/http/httptest.(*Server).Start
    /usr/go/src/net/http/httptest/server.go:109 +0x2a8

goroutine 16 [syscall]:
syscall.Syscall6(0x7, 0x1057e000, 0x8000, 0xffffffff, 0xffffffff, 0x0, 0x0, 0x1d0260, 0x104f62c0, 0x10538ee0, ...)
    /usr/go/src/syscall/asm_plan9_386.s:57 +0x5
syscall.Pread(0x7, 0x1057e000, 0x8000, 0x8000, 0xffffffff, 0xffffffff, 0xd58ab, 0x0, 0x0)
    /usr/go/src/syscall/zsyscall_plan9_386.go:121 +0x79
syscall.Read(0x7, 0x1057e000, 0x8000, 0x8000, 0x0, 0x0, 0x0)
    /usr/go/src/syscall/syscall_plan9.go:123 +0x5f
os.(*File).read(0x104c0548, 0x1057e000, 0x8000, 0x8000, 0x35d80, 0x0, 0x0)
    /usr/go/src/os/file_plan9.go:248 +0x54
os.(*File).Read(0x104c0548, 0x1057e000, 0x8000, 0x8000, 0x1, 0x0, 0x0)
    /usr/go/src/os/file.go:95 +0x75
net.(*netFD).Read(0x104f6680, 0x1057e000, 0x8000, 0x8000, 0x0, 0x0, 0x0)
    /usr/go/src/net/fd_plan9.go:134 +0x103
net.(*conn).Read(0x104c0558, 0x1057e000, 0x8000, 0x8000, 0x0, 0x0, 0x0)
    /usr/go/src/net/net.go:121 +0x89
io.Copy(0x304b0228, 0x104c0530, 0x304afbe8, 0x104c0558, 0x0, 0x0, 0x0, 0x0)
    /usr/go/src/io/io.go:362 +0x1d7
net/http.func·009()
    /usr/go/src/net/http/server.go:174 +0x65
created by net/http.(*conn).closeNotify
    /usr/go/src/net/http/server.go:180 +0x286

goroutine 14 [syscall]:
syscall.Syscall6(0x8, 0x10516000, 0x1000, 0xffffffff, 0xffffffff, 0x0, 0x0, 0x3049e000, 0x0, 0x0, ...)
    /usr/go/src/syscall/asm_plan9_386.s:57 +0x5
syscall.Pread(0x8, 0x10516000, 0x1000, 0x1000, 0xffffffff, 0xffffffff, 0xd58ab, 0x0, 0x0)
    /usr/go/src/syscall/zsyscall_plan9_386.go:121 +0x79
syscall.Read(0x8, 0x10516000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/go/src/syscall/syscall_plan9.go:123 +0x5f
os.(*File).read(0x104c0578, 0x10516000, 0x1000, 0x1000, 0x35d80, 0x0, 0x0)
    /usr/go/src/os/file_plan9.go:248 +0x54
os.(*File).Read(0x104c0578, 0x10516000, 0x1000, 0x1000, 0x104dd1c0, 0x0, 0x0)
    /usr/go/src/os/file.go:95 +0x75
net.(*netFD).Read(0x104f66c0, 0x10516000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/go/src/net/fd_plan9.go:134 +0x103
net.(*conn).Read(0x104c0588, 0x10516000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/go/src/net/net.go:121 +0x89
net/http.noteEOFReader.Read(0x304afbe8, 0x104c0588, 0x104fe08c, 0x10516000, 0x1000, 0x1000, 0x104b04a0, 0x0, 0x0)
    /usr/go/src/net/http/transport.go:1276 +0x5b
net/http.(*noteEOFReader).Read(0x104b09e0, 0x10516000, 0x1000, 0x1000, 0x104dcf20, 0x0, 0x0)
    <autogenerated>:127 +0x9e
bufio.(*Reader).fill(0x104de510)
    /usr/go/src/bufio/bufio.go:97 +0x15b
bufio.(*Reader).Peek(0x104de510, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/go/src/bufio/bufio.go:132 +0xd1
net/http.(*persistConn).readLoop(0x104fe060)
    /usr/go/src/net/http/transport.go:842 +0x90
created by net/http.(*Transport).dialConn
    /usr/go/src/net/http/transport.go:660 +0xa6e

goroutine 13 [select]:
net/http.(*persistConn).roundTrip(0x104fe000, 0x104c0580, 0x0, 0x0, 0x0)
    /usr/go/src/net/http/transport.go:1086 +0x748
net/http.(*Transport).RoundTrip(0x105021c0, 0x10502230, 0xf, 0x0, 0x0)
    /usr/go/src/net/http/transport.go:235 +0x42c
net/http/httputil.(*ReverseProxy).ServeHTTP(0x104dcc40, 0x304b0138, 0x104ae880, 0x105020e0)
    /usr/go/src/net/http/httputil/reverseproxy.go:191 +0x748
net/http/httptest.(*waitGroupHandler).ServeHTTP(0x104b0750, 0x304b0138, 0x104ae880, 0x105020e0)
    /usr/go/src/net/http/httptest/server.go:200 +0xa4
net/http.serverHandler.ServeHTTP(0x104f6380, 0x304b0138, 0x104ae880, 0x105020e0)
    /usr/go/src/net/http/server.go:1760 +0x144
net/http.(*conn).serve(0x104fe300)
    /usr/go/src/net/http/server.go:1261 +0xa17
created by net/http.(*Server).Serve
    /usr/go/src/net/http/server.go:1808 +0x303

goroutine 15 [select]:
net/http.(*persistConn).writeLoop(0x104fe060)
    /usr/go/src/net/http/transport.go:945 +0x319
created by net/http.(*Transport).dialConn
    /usr/go/src/net/http/transport.go:661 +0xa8a

goroutine 22 [select]:
net/http/httputil.func·006()
    /usr/go/src/net/http/httputil/reverseproxy.go:145 +0xeb
created by net/http/httputil.func·007
    /usr/go/src/net/http/httputil/reverseproxy.go:150 +0xdd

goroutine 20 [syscall]:
syscall.Syscall6(0xd, 0x10596000, 0x1000, 0xffffffff, 0xffffffff, 0x0, 0x0, 0x3049e000, 0x0, 0x0, ...)
    /usr/go/src/syscall/asm_plan9_386.s:57 +0x5
syscall.Pread(0xd, 0x10596000, 0x1000, 0x1000, 0xffffffff, 0xffffffff, 0xd58ab, 0x0, 0x0)
    /usr/go/src/syscall/zsyscall_plan9_386.go:121 +0x79
syscall.Read(0xd, 0x10596000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/go/src/syscall/syscall_plan9.go:123 +0x5f
os.(*File).read(0x104c0428, 0x10596000, 0x1000, 0x1000, 0x35d80, 0x0, 0x0)
    /usr/go/src/os/file_plan9.go:248 +0x54
os.(*File).Read(0x104c0428, 0x10596000, 0x1000, 0x1000, 0x104dd1a0, 0x0, 0x0)
    /usr/go/src/os/file.go:95 +0x75
net.(*netFD).Read(0x104f6400, 0x10596000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/go/src/net/fd_plan9.go:134 +0x103
net.(*conn).Read(0x104c04b0, 0x10596000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/go/src/net/net.go:121 +0x89
net/http.noteEOFReader.Read(0x304afbe8, 0x104c04b0, 0x104fe02c, 0x10596000, 0x1000, 0x1000, 0x104b06bd, 0x0, 0x0)
    /usr/go/src/net/http/transport.go:1276 +0x5b
net/http.(*noteEOFReader).Read(0x104b06f0, 0x10596000, 0x1000, 0x1000, 0x104dcfa0, 0x0, 0x0)
    <autogenerated>:127 +0x9e
bufio.(*Reader).fill(0x104de4b0)
    /usr/go/src/bufio/bufio.go:97 +0x15b
bufio.(*Reader).Peek(0x104de4b0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/go/src/bufio/bufio.go:132 +0xd1
net/http.(*persistConn).readLoop(0x104fe000)
    /usr/go/src/net/http/transport.go:842 +0x90
created by net/http.(*Transport).dialConn
    /usr/go/src/net/http/transport.go:660 +0xa6e

goroutine 21 [select]:
net/http.(*persistConn).writeLoop(0x104fe000)
    /usr/go/src/net/http/transport.go:945 +0x319
created by net/http.(*Transport).dialConn
    /usr/go/src/net/http/transport.go:661 +0xa8a

goroutine 23 [syscall]:
syscall.Syscall6(0xc, 0x105a8000, 0x8000, 0xffffffff, 0xffffffff, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /usr/go/src/syscall/asm_plan9_386.s:57 +0x5
syscall.Pread(0xc, 0x105a8000, 0x8000, 0x8000, 0xffffffff, 0xffffffff, 0xd58ab, 0x0, 0x0)
    /usr/go/src/syscall/zsyscall_plan9_386.go:121 +0x79
syscall.Read(0xc, 0x105a8000, 0x8000, 0x8000, 0x0, 0x0, 0x0)
    /usr/go/src/syscall/syscall_plan9.go:123 +0x5f
os.(*File).read(0x104c0610, 0x105a8000, 0x8000, 0x8000, 0x35d80, 0x0, 0x0)
    /usr/go/src/os/file_plan9.go:248 +0x54
os.(*File).Read(0x104c0610, 0x105a8000, 0x8000, 0x8000, 0x1, 0x0, 0x0)
    /usr/go/src/os/file.go:95 +0x75
net.(*netFD).Read(0x104f6a80, 0x105a8000, 0x8000, 0x8000, 0x0, 0x0, 0x0)
    /usr/go/src/net/fd_plan9.go:134 +0x103
net.(*conn).Read(0x104c0620, 0x105a8000, 0x8000, 0x8000, 0x0, 0x0, 0x0)
    /usr/go/src/net/net.go:121 +0x89
io.Copy(0x304b0228, 0x104c0638, 0x304afbe8, 0x104c0620, 0x0, 0x0, 0x0, 0x0)
    /usr/go/src/io/io.go:362 +0x1d7
net/http.func·009()
    /usr/go/src/net/http/server.go:174 +0x65
created by net/http.(*conn).closeNotify
    /usr/go/src/net/http/server.go:180 +0x286
--- FAIL: TestReverseProxyCancellation (10.20s)
    reverseproxy_test.go:229: Failed to close backend connection
    reverseproxy_test.go:266: Non-nil response
FAIL
exit status: 'httputil.test 3001866: 1'
FAIL    net/http/httputil   10.276s

0intro added a commit that referenced this issue Jan 10, 2015

net/http/httputil: skip TestReverseProxyCancellation on Plan 9
Update #9554

Change-Id: I7de2a7d585d56b84ab975565042ed997e6124e08
Reviewed-on: https://go-review.googlesource.com/2613
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>

@rsc rsc removed the os-plan9 label Apr 10, 2015

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@bradfitz

This comment has been minimized.

@0intro

This comment has been minimized.

Copy link
Member Author

commented Jun 29, 2015

I've just opened issue #11476.

@gopherbot

This comment has been minimized.

Copy link

commented Oct 16, 2015

CL https://golang.org/cl/15941 mentions this issue.

@bradfitz bradfitz closed this in 368f73b Oct 16, 2015

@golang golang locked and limited conversation to collaborators Oct 17, 2016

@gopherbot

This comment has been minimized.

Copy link

commented Oct 20, 2016

CL https://golang.org/cl/31520 mentions this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.