Skip to content

rpc: replacement for gorilla/websocket #27261

@holiman

Description

@holiman

From time to time, we hit this on appveyor (primarily windows-tests)

panic: The handle is invalid.
goroutine 10137 [running]:
internal/poll.execIO(0xc00007b198, 0x1023ac0)
	C:/Users/appveyor/AppData/Local/geth-go-1.20.3-windows-amd64/go/src/internal/poll/fd_windows.go:201 +0x385
internal/poll.(*FD).Read(0xc00007b180, {0xc000224000, 0x400, 0x400})
	C:/Users/appveyor/AppData/Local/geth-go-1.20.3-windows-amd64/go/src/internal/poll/fd_windows.go:436 +0x2b8
net.(*netFD).Read(0xc00007b180, {0xc000224000?, 0xc0002917d6?, 0xc0002917d5?})
	C:/Users/appveyor/AppData/Local/geth-go-1.20.3-windows-amd64/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc00000a668, {0xc000224000?, 0x187d985a1e8?, 0x187b1760108?})
	C:/Users/appveyor/AppData/Local/geth-go-1.20.3-windows-amd64/go/src/net/net.go:183 +0x45
bufio.(*Reader).fill(0xc0001b6780)
	C:/Users/appveyor/AppData/Local/geth-go-1.20.3-windows-amd64/go/src/bufio/bufio.go:106 +0xff
bufio.(*Reader).Peek(0xc0001b6780, 0x2)
	C:/Users/appveyor/AppData/Local/geth-go-1.20.3-windows-amd64/go/src/bufio/bufio.go:144 +0x5d
github.com/gorilla/websocket.(*Conn).read(0xc000238000, 0xc00687a898?)
	C:/Users/appveyor/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:370 +0x2c
github.com/gorilla/websocket.(*Conn).advanceFrame(0xc000238000)
	C:/Users/appveyor/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:798 +0x7b
github.com/gorilla/websocket.(*Conn).NextReader(0xc000238000)
	C:/Users/appveyor/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:980 +0xcc
github.com/gorilla/websocket.(*Conn).ReadJSON(0x18?, {0xf717e0, 0xc00297a5e8})
	C:/Users/appveyor/go/pkg/mod/github.com/gorilla/[email protected]/json.go:50 +0x27
github.com/ethereum/go-ethereum/rpc.(*jsonCodec).readBatch(0xc000067c70)
	C:/projects/go-ethereum/rpc/json.go:225 +0x4d
github.com/ethereum/go-ethereum/rpc.(*Client).read(0xc000261680, {0x10a42b0, 0xc00015a630})
	C:/projects/go-ethereum/rpc/client.go:664 +0xa2
created by github.com/ethereum/go-ethereum/rpc.(*Client).dispatch
	C:/projects/go-ethereum/rpc/client.go:588 +0x155
FAIL	github.com/ethereum/go-ethereum/rpc	12.572s
ok  	github.com/ethereum/go-ethereum/signer/core	4.988s

The gorilla/websocket package is archived, https://github.com/gorilla/ , see here for more details.

We should look into either replacing gorilla with another library, or see if we can simply swap it out for the standard library components.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions