Websocket in GoLang SDK closes randomly after some time


  • Websocket in GoLang SDK closes randomly after some time and its not able to reconnect

    2021/06/04 12:56:12 Connected
    2021/06/04 12:56:35 Error: Error reading data: websocket: close 1006 (abnormal closure): unexpected EOF
    2021/06/04 12:58:12 Error: write tcp 192.168.1.12:59665->103.82.177.98:443: wsasend: An established connection was aborted by the software in your host machine.
    2021/06/04 12:59:12 Error: write tcp 192.168.1.12:59665->103.82.177.98:443: wsasend: An established connection was aborted by the software in your host machine.
    2021/06/04 13:00:12 Error: write tcp 192.168.1.12:59665->103.82.177.98:443: wsasend: An established connection was aborted by the software in your host machine.
    Reconnect attempt 3 in 8.000000s
    2021/06/04 13:00:20 Connected
    2021/06/04 13:05:36 Error: Error reading data: websocket: close 1006 (abnormal closure): unexpected EOF
    2021/06/04 13:06:20 Error: write tcp 192.168.1.12:51925->103.82.177.98:443: wsasend: An established connection was aborted by the software in your host machine.
    2021/06/04 13:07:12 Error: write tcp 192.168.1.12:51925->103.82.177.98:443: wsasend: An established connection was aborted by the software in your host machine.
    panic: sync: negative WaitGroup counter

    goroutine 52 [running]:
    sync.(*WaitGroup).Add(0xc0003a46d0, 0xffffffffffffffff)
    c:/go/src/sync/waitgroup.go:74 +0x140
    sync.(*WaitGroup).Done(...)
    c:/go/src/sync/waitgroup.go:99
    github.com/angelbroking-github/smartapigo/websocket.(*SocketClient).checkConnection(0xc0001c4a20, 0xc0003a46d0)
    C:/Users/ABC/projects/smartapigo/websocket/websocket.go:315 +0x195
    created by github.com/angelbroking-github/smartapigo/websocket.(*SocketClient).Serve
    C:/Users/ABC/projects/smartapigo/websocket/websocket.go:253 +0x5f2
    exit status 2


  • HI @viralt The above issue is resolved.


  • Hi @viralt we are following up with the team we appreciate your patience. we will update here once fixed.


  • @viralt said in Websocket in GoLang SDK closes randomly after some time:

    panic: sync: negative WaitGroup counter
    goroutine 52 [running]:
    sync.(*WaitGroup).Add(0xc0003a46d0, 0xffffffffffffffff)
    c:/go/src/sync/waitgroup.go:74 +0x140
    sync.(*WaitGroup).Done(...)
    c:/go/src/sync/waitgroup.go:99
    github.com/angelbroking-github/smartapigo/websocket.(*SocketClient).checkConnection(0xc0001c4a20, 0xc0003a46d0)
    C:/Users/ABC/projects/smartapigo/websocket/websocket.go:315 +0x195
    created by github.com/angelbroking-github/smartapigo/websocket.(*SocketClient).Serve
    C:/Users/ABC/projects/smartapigo/websocket/websocket.go:253 +0x5f2
    exit status 2

    any update on this ?


  • Hi @viralt we have noted this we will report this and update you on this.