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 on RPC request serving due to concurrent new peer connection #3752

Open
AnnaShaleva opened this issue Dec 13, 2024 · 0 comments
Open
Labels
bug Something isn't working I4 No visible changes network P2P layer S3 Minimally significant U2 Seriously planned
Milestone

Comments

@AnnaShaleva
Copy link
Member

Current Behavior

Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]: INFO        new peer connected        {"addr": "3.112.138.57:61112", "peerCount": 31}
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]: 2024/12/13 09:56:08 http: panic serving 127.0.0.1:43214: runtime error: invalid memory address or nil pointer dereference
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]: goroutine 25293644 [running]:
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]: net/http.(*conn).serve.func1()
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]:         net/http/server.go:1947 +0xbe
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]: panic({0x1193140?, 0x1f51a00?})
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]:         runtime/panic.go:785 +0x132
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]: github.com/nspcc-dev/neo-go/pkg/network.(*Server).ConnectedPeers(0xc000f44a08)
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]:         github.com/nspcc-dev/neo-go/pkg/network/server.go:459 +0x254
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]: github.com/nspcc-dev/neo-go/pkg/services/rpcsrv.(*Server).getPeers(0xc000ea2a08, {0xc000312330?, 0xc000a833d0?, 0x8?})
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]:         github.com/nspcc-dev/neo-go/pkg/services/rpcsrv/server.go:904 +0x8d
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]: github.com/nspcc-dev/neo-go/pkg/services/rpcsrv.(*Server).handleIn(0xc000ea2a08, 0xc002a7ddb0, 0x0)
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]:         github.com/nspcc-dev/neo-go/pkg/services/rpcsrv/server.go:645 +0x60a
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]: github.com/nspcc-dev/neo-go/pkg/services/rpcsrv.(*Server).handleRequest(0xc000ea2a08, 0xc00b47c140, 0x0)
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]:         github.com/nspcc-dev/neo-go/pkg/services/rpcsrv/server.go:571 +0xd1
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]: github.com/nspcc-dev/neo-go/pkg/services/rpcsrv.(*Server).handleHTTPRequest(0xc000ea2a08, {0x15efb60, 0xc001f20620}, 0xc001f38a00)
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]:         github.com/nspcc-dev/neo-go/pkg/services/rpcsrv/server.go:551 +0x9ea
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]: net/http.HandlerFunc.ServeHTTP(0x410845?, {0x15efb60?, 0xc001f20620?}, 0xc001f20601?)
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]:         net/http/server.go:2220 +0x29
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]: net/http.serverHandler.ServeHTTP({0x15e9970?}, {0x15efb60?, 0xc001f20620?}, 0x6?)
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]:         net/http/server.go:3210 +0x8e
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]: net/http.(*conn).serve(0xc0034c0750, {0x15f1980, 0xc0009bbe90})
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]:         net/http/server.go:2092 +0x5d0
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]: created by net/http.(*Server).Serve in goroutine 782
Dec 13 09:56:08 kaede neogo-mainnet-rpc[1894253]:         net/http/server.go:3360 +0x485
Dec 13 09:56:12 kaede neogo-mainnet-rpc[1894253]: INFO        new peer connected        {"addr": "3.112.138.57:20513", "peerCount": 32}
Dec 13 09:56:13 kaede neogo-mainnet-rpc[1894253]: INFO        peer disconnected        {"addr": "3.112.138.57:20513", "error": "read tcp 157.90.177.38:10333->3.112.138.57:20513: read: connection reset by peer", "peerCount": 31}

Expected Behavior

No panic.

@AnnaShaleva AnnaShaleva added bug Something isn't working network P2P layer U2 Seriously planned S3 Minimally significant I4 No visible changes labels Dec 13, 2024
@AnnaShaleva AnnaShaleva added this to the v0.108.0 milestone Dec 13, 2024
@AnnaShaleva AnnaShaleva changed the title Panic on new peer connection Panic on RPC request serving due to concurrent new peer connection Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working I4 No visible changes network P2P layer S3 Minimally significant U2 Seriously planned
Projects
None yet
Development

No branches or pull requests

1 participant