celestiaorg / celestiaorg/autoscale-proxy

bug: panic when sending to closed request

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

```sh
time="2024-01-31T18:14:06Z" level=error msg="Failed to send request: Post \"https://rpc-snapscale.lunaroasis.net/\": http: invalid Read on closed Body"
2024/01/31 18:14:06 http: panic serving 100.64.46.71:50486: invalid WriteHeader code 0
goroutine 3069625 [running]:
net/http.(*conn).serve.func1()
/usr/local/go/src/net/http/server.go:1868 +0xb9
panic({0x6c81a0?, 0xc000a800f0?})
/usr/local/go/src/runtime/panic.go:920 +0x270
net/http.checkWriteHeaderCode(...)
/usr/local/go/src/net/http/server.go:1121
net/http.(*response).WriteHeader(0xc0006f0e00, 0x0)
/usr/local/go/src/net/http/server.go:1155 +0xa0a
main.handleHttpRequest({0x7b23f0, 0xc0006f0e00}, 0xc000281300)
/app/main.go:134 +0x922
main.handleRequest({0x7b23f0?, 0xc0006f0e00?}, 0x6320ed?)
/app/main.go:241 +0x1d
net/http.HandlerFunc.ServeHTTP(0x10?, {0x7b23f0?, 0xc0006f0e00?}, 0xc000b231ac?)
/usr/local/go/src/net/http/server.go:2136 +0x29
net/http.(*ServeMux).ServeHTTP(0x40d245?, {0x7b23f0, 0xc0006f0e00}, 0xc000281300)
/usr/local/go/src/net/http/server.go:2514 +0x142
net/http.serverHandler.ServeHTTP({0x7b1430?}, {0x7b23f0?, 0xc0006f0e00?}, 0x6?)
/usr/local/go/src/net/http/server.go:2938 +0x8e
net/http.(*conn).serve(0xc000a4b8c0, {0x7b2990, 0xc00009ac60})
/usr/local/go/src/net/http/server.go:2009 +0x5f4
```

Contributor guide

Open the contributing guide

Research direction

Start in main.go at line 134, where the panic occurs, and trace the request through handleRequest at line 241. Reproduce the closed-request case from the reported log and verify that sending to a closed request no longer produces an invalid WriteHeader panic.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.