-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixing races During work with library I encounted couple races For example: panic: runtime error: slice bounds out of range [:1026] with capacity 1024 goroutine 125171 [running]: bufio.(*Reader).Peek(0xc012610de0, 0x2) /usr/local/go/src/bufio/bufio.go:165 +0x16a github.com/gorilla/websocket.(*Conn).read(0xc01210cc60, 0x0?) /go/pkg/mod/github.com/gorilla/[email protected]/conn.go:378 +0x26 github.com/gorilla/websocket.(*Conn).advanceFrame(0xc01210cc60) /go/pkg/mod/github.com/gorilla/[email protected]/conn.go:824 +0x6d github.com/gorilla/websocket.(*Conn).NextReader(0xc01210cc60) /go/pkg/mod/github.com/gorilla/[email protected]/conn.go:1034 +0x13e github.com/gorilla/websocket.(*Conn).ReadMessage(0xc00e924620?) /go/pkg/mod/github.com/gorilla/[email protected]/conn.go:1120 +0x13 github.com/aopoltorzhicky/go_kraken/websocket.(*Kraken).listenSocket(0xc0003ba0e0) /go/pkg/mod/github.com/aopoltorzhicky/[email protected]/websocket/kraken.go:198 +0x168 created by github.com/aopoltorzhicky/go_kraken/websocket.(*Kraken).managerThread in goroutine 82 /go/pkg/mod/github.com/aopoltorzhicky/[email protected]/websocket/kraken.go:109 +0x227 So following patch should addres this problem. Issues: 1. Multiple listenSocket methods 2. Possible lock leaks 3. Shouldn't be sends in parallel 4. Switch to close, multiple listeners Refactor * only one close
- Loading branch information
1 parent
314d408
commit 89349a3
Showing
1 changed file
with
33 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters