Skip to content

🐞 [Bug]: peer.process panic: send on closed channel #1476

@sameh-farouk

Description

@sameh-farouk

What happened?

Late responses for just timed‑out calls causingpeer.process panic due to "send on closed channel".

Deleting from the map from one Goroutine does not protect against the race, because the channel value is already loaded into the local ch variable on Router Goroutine before the delete (the race).

which network/s did you face the problem on?

Main

Relevant log output

2025-12-01T16:35:01Z error peer.process panic recovered panic="send on closed channel" stack="goroutine 63 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:26 +0x5e\ngithub.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go/peer.(*Peer).process.func1()\n\t/rmb-sdk-go/peer/peer.go:465 +0x76\npanic({0xf340c0?, 0x13096b0?})\n\t/usr/local/go/src/runtime/panic.go:783 +0x132\ngithub.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go/peer.(*RpcClient).router(0xc00200b9b0?, {0xc002325950?, 0x21?}, 0x21?, 0xc0022a20c0, {0x0, 0x0})\n\t/rmb-sdk-go/peer/rpc.go:80 +0xdd\ngithub.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go/peer.(*Peer).process(0xc00035cbe0, {0x1318db0, 0xc000880320})\n\t/rmb-sdk-go/peer/peer.go:490 +0x23b\ngithub.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go/peer.NewPeer.func3()\n\t/rmb-sdk-go/peer/peer.go:390 +0x51\ncreated by github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go/peer.NewPeer in goroutine 1\n\t/rmb-sdk-go/peer/peer.go:388 +0xbc5\n"

Metadata

Metadata

Assignees

No one assigned

    Labels

    rmb-sdkbelongs to rmb

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions