Skip to content

Unblock outbound body pipe on inbound read error

Mikhail Mazurskiy requested to merge ash2k/grpc-to-http-blocking into master

Relates to Investigate tunnel registration GC spike w.r.t ... (#589).

On master the added test crashes with:

=== RUN   TestGRPC2HTTP_ErrorReceivingGRPCRequest
    logger.go:38: time=2024-08-20T15:28:18.827+10:00 level=DEBUG source=inbound_grpc_to_outbound_http.go:206 msg="Handling BOOM /asd/asd/asd?adasd=a"
fatal error: all goroutines are asleep - deadlock!

goroutine 1 [chan receive]:
testing.(*T).Run(0x140002efd40, {0x103531b7f?, 0x140002adb48?}, 0x1038d2360)
	/opt/homebrew/opt/go/libexec/src/testing/testing.go:1751 +0x328
testing.runTests.func1(0x140002efd40)
	/opt/homebrew/opt/go/libexec/src/testing/testing.go:2168 +0x40
testing.tRunner(0x140002efd40, 0x140002adc68)
	/opt/homebrew/opt/go/libexec/src/testing/testing.go:1690 +0xe4
testing.runTests(0x14000139ae8, {0x1040385c0, 0x54, 0x54}, {0xc800000000000000?, 0xc88c8e34b1c76091?, 0x0?})
	/opt/homebrew/opt/go/libexec/src/testing/testing.go:2166 +0x3ac
testing.(*M).Run(0x1400039d220)
	/opt/homebrew/opt/go/libexec/src/testing/testing.go:2034 +0x588
main.main()
	_testmain.go:219 +0x90

goroutine 20 [select]:
io.(*pipe).read(0x140003a6480, {0x140003ad048, 0x1, 0x140003b1f80?})
	/opt/homebrew/opt/go/libexec/src/io/pipe.go:57 +0x84
io.(*PipeReader).Read(0x10?, {0x140003ad048?, 0x14000186b58?, 0x102cc3354?})
	/opt/homebrew/opt/go/libexec/src/io/pipe.go:134 +0x24
gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v17/internal/tool/grpctool_test.TestGRPC2HTTP_ErrorReceivingGRPCRequest.func1({0x14000186c08?, 0x14000186b88?}, 0x18?, {0x1038d8dc0, 0x140003a6480})
	/Users/mike/src/gitlab-agent/internal/tool/grpctool/inbound_grpc_to_outbound_http_test.go:686 +0x54
gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v17/internal/tool/grpctool.(*InboundGRPCToOutboundHTTP).Pipe.func3()
	/Users/mike/src/gitlab-agent/internal/tool/grpctool/inbound_grpc_to_outbound_http.go:105 +0x168
gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v17/internal/tool/grpctool.(*InboundStreamToOutboundStream).Pipe(0x140003b09a0)
	/Users/mike/src/gitlab-agent/internal/tool/grpctool/inbound_stream_to_outbound_stream.go:36 +0x90
gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v17/internal/tool/grpctool.(*InboundGRPCToOutboundHTTP).Pipe(0x1400015f500, {0x1038ebb00, 0x140003b0810})
	/Users/mike/src/gitlab-agent/internal/tool/grpctool/inbound_grpc_to_outbound_http.go:117 +0x2d0
gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v17/internal/tool/grpctool_test.TestGRPC2HTTP_ErrorReceivingGRPCRequest(0x140003e6000)
	/Users/mike/src/gitlab-agent/internal/tool/grpctool/inbound_grpc_to_outbound_http_test.go:689 +0x83c
testing.tRunner(0x140003e6000, 0x1038d2360)
	/opt/homebrew/opt/go/libexec/src/testing/testing.go:1690 +0xe4
created by testing.(*T).Run in goroutine 1
	/opt/homebrew/opt/go/libexec/src/testing/testing.go:1743 +0x314

Merge request reports

Loading