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

Panic: Write called after Handler finished #276

Closed
jlewi opened this issue Oct 4, 2024 · 1 comment
Closed

Panic: Write called after Handler finished #276

jlewi opened this issue Oct 4, 2024 · 1 comment

Comments

@jlewi
Copy link
Owner

jlewi commented Oct 4, 2024

Here's the stack trace

2024-10-04T14:50:48.081-0700	INFO	agent/agent.go:217	Received trigger signal	{"traceId": "2d4c199da0aa1aeb62bc7698cd50b49e", "evalMode": false}
panic: Write called after Handler finished
	panic: Header called after Handler finished

goroutine 37228 [running]:
golang.org/x/net/http2.(*responseWriter).FlushError(0x14000f21688?)
	/Users/jlewi/go/pkg/mod/golang.org/x/net@v0.27.0/http2/server.go:2865 +0x118
golang.org/x/net/http2.(*responseWriter).Flush(0x105e4d7a0?)
	/Users/jlewi/go/pkg/mod/golang.org/x/net@v0.27.0/http2/server.go:2859 +0x1c
github.com/gin-gonic/gin.(*responseWriter).Flush(0x10722c2f0?)
	/Users/jlewi/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/response_writer.go:123 +0xb4
connectrpc.com/connect.flushResponseWriter(...)
	/Users/jlewi/go/pkg/mod/connectrpc.com/connect@v1.16.2/protocol.go:357
panic({0x105d4c280?, 0x1061713a0?})
	/opt/homebrew/Cellar/go/1.22.5/libexec/src/runtime/panic.go:770 +0x124
golang.org/x/net/http2.(*responseWriter).write(0x14007d64000?, 0x107d29878?, {0x14000a4ea41?, 0x14000600008?, 0x18?}, {0x0?, 0x0?})
	/Users/jlewi/go/pkg/mod/golang.org/x/net@v0.27.0/http2/server.go:3010 +0x15c
golang.org/x/net/http2.(*responseWriter).Write(0x5?, {0x14000a4ea41?, 0x14000f21701?, 0x1043eb9b8?})
	/Users/jlewi/go/pkg/mod/golang.org/x/net@v0.27.0/http2/server.go:2999 +0x38
github.com/gin-gonic/gin.(*responseWriter).Write(0x14002a0a100, {0x14000a4ea41?, 0x14000f21878?, 0x1043ec32c?})
	/Users/jlewi/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/response_writer.go:83 +0x7c
connectrpc.com/connect.(*envelope).WriteTo(0x14004d00228, {0x14eccc768, 0x14002a0a100})
	/Users/jlewi/go/pkg/mod/connectrpc.com/connect@v1.16.2/envelope.go:79 +0xc0
connectrpc.com/connect.writeSender.Send(...)
	/Users/jlewi/go/pkg/mod/connectrpc.com/connect@v1.16.2/duplex_http_call.go:391
connectrpc.com/connect.(*envelopeWriter).write(0x14000915d58, 0x1043ec32c?)
	/Users/jlewi/go/pkg/mod/connectrpc.com/connect@v1.16.2/envelope.go:212 +0x3c
connectrpc.com/connect.(*envelopeWriter).Write(0x14000915d58, 0x14004d00210)
	/Users/jlewi/go/pkg/mod/connectrpc.com/connect@v1.16.2/envelope.go:167 +0x1f8
connectrpc.com/connect.(*envelopeWriter).marshalAppend(0x14000915d58, {0x10602e360, 0x140007e0000}, {0x14eccc9a0, 0x1072e01e0})
	/Users/jlewi/go/pkg/mod/connectrpc.com/connect@v1.16.2/envelope.go:195 +0x22c
connectrpc.com/connect.(*envelopeWriter).Marshal(0x7fe579ab5bb5db73?, {0x10602e360?, 0x140007e0000?})
	/Users/jlewi/go/pkg/mod/connectrpc.com/connect@v1.16.2/envelope.go:143 +0x120
connectrpc.com/connect.(*connectStreamingHandlerConn).Send(0x0?, {0x10602e360?, 0x140007e0000?})
	/Users/jlewi/go/pkg/mod/connectrpc.com/connect@v1.16.2/protocol_connect.go:809 +0x68
connectrpc.com/connect.(*errorTranslatingHandlerConnCloser).Send(0x1400032cae0, {0x10602e360?, 0x140007e0000?})
	/Users/jlewi/go/pkg/mod/connectrpc.com/connect@v1.16.2/protocol.go:176 +0x38
connectrpc.com/otelconnect.(*streamingState).send(0x14000ea86c0, {0x106192470, 0x14001b16db0}, {0x10602e360, 0x140007e0000}, {0x14ec37400?, 0x1400032cae0?})
	/Users/jlewi/go/pkg/mod/connectrpc.com/otelconnect@v0.7.1/streaming.go:102 +0x5c
connectrpc.com/otelconnect.(*Interceptor).WrapStreamingHandler.func1.2({0x10602e360?, 0x140007e0000?}, {0x14eccc7a8?, 0x1400032cae0?})
	/Users/jlewi/go/pkg/mod/connectrpc.com/otelconnect@v0.7.1/interceptor.go:321 +0x74
connectrpc.com/otelconnect.(*streamingHandlerInterceptor).Send(0x40?, {0x10602e360?, 0x140007e0000?})
	/Users/jlewi/go/pkg/mod/connectrpc.com/otelconnect@v0.7.1/payloadinterceptor.go:55 +0x40
connectrpc.com/connect.(*BidiStream[...]).Send(0x14001b16fc0?, 0x14001dd03c0?)
	/Users/jlewi/go/pkg/mod/connectrpc.com/connect@v1.16.2/handler_stream.go:191 +0x30
github.com/jlewi/foyle/app/pkg/agent.(*Agent).StreamGenerate.func1({0x1061924a8, 0x14001dd03c0})
	/Users/jlewi/git_foyle/app/pkg/agent/agent.go:255 +0x230
created by github.com/jlewi/foyle/app/pkg/agent.(*Agent).StreamGenerate in goroutine 37245
	/Users/jlewi/git_foyle/app/pkg/agent/agent.go:213 +0x3fc
@jlewi
Copy link
Owner Author

jlewi commented Nov 4, 2024

Duplicate of #319

@jlewi jlewi marked this as a duplicate of #319 Nov 4, 2024
@jlewi jlewi closed this as completed Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant