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

websocket/Gemini websocket negative waitgroup on shutdown #1738

Closed
gloriousCode opened this issue Dec 5, 2024 · 1 comment · Fixed by #1625
Closed

websocket/Gemini websocket negative waitgroup on shutdown #1738

gloriousCode opened this issue Dec 5, 2024 · 1 comment · Fixed by #1625

Comments

@gloriousCode
Copy link
Collaborator

New Issue

Context

Testing other people's weird code. Upon closing GCT receive the following output:

^C[INFO]  | LOG | 05/12/2024 13:04:02 | Captured interrupt, shutdown requested.
[DEBUG] | LOG | 05/12/2024 13:04:02 | Engine shutting down..
[DEBUG] | ORDER | 05/12/2024 13:04:02 | Order manager shutting down...
[DEBUG] | PORTFOLIO | 05/12/2024 13:04:02 | Portfolio manager shutting down...
[DEBUG] | CONNECTION | 05/12/2024 13:04:02 | Connection manager shutting down...
[DEBUG] | CONNECTION | 05/12/2024 13:04:02 | Connection manager stopped.
[DEBUG] | ORDER | 05/12/2024 13:04:02 | Order manager shutdown.
[DEBUG] | PORTFOLIO | 05/12/2024 13:04:02 | Portfolio manager shutdown.
[DEBUG] | DISPATCH | 05/12/2024 13:04:02 | Dispatch manager shutting down...
[DEBUG] | DISPATCH | 05/12/2024 13:04:02 | Dispatch manager shutdown
[DEBUG] | EXCHANGE | 05/12/2024 13:04:02 | Currency state manager shutting down...
[DEBUG] | EXCHANGE | 05/12/2024 13:04:02 | Currency state manager shutdown.
[DEBUG] | WEBSOCKET | 05/12/2024 13:04:02 | Gemini websocket: shutting down websocket
[DEBUG] | WEBSOCKET | 05/12/2024 13:04:02 | Gemini websocket: trafficMonitor shutdown message received
[DEBUG] | WEBSOCKET | 05/12/2024 13:04:02 | Gemini websocket: completed websocket shutdown
panic: sync: negative WaitGroup counter

goroutine 86 [running]:
sync.(*WaitGroup).Add(0x140002f0200?, 0x14000d8c020?)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/sync/waitgroup.go:64 +0x108
sync.(*WaitGroup).Done(...)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/sync/waitgroup.go:89
github.com/thrasher-corp/gocryptotrader/exchanges/stream.(*Websocket).monitorFrame(0x0?, 0x140002f0300, 0x0?)
	/Users/WIF/go/src/github.com/thrasher-corp/gocryptotrader/exchanges/stream/websocket.go:1112 +0x9c
created by github.com/thrasher-corp/gocryptotrader/exchanges/stream.(*Websocket).connect in goroutine 84
	/Users/WIF/go/src/github.com/thrasher-corp/gocryptotrader/exchanges/stream/websocket.go:336 +0x128
exit status 2

Additional context:

  • MacOS
  • Go v 1.23.3
  • Gemini only enabled exchange
  • Authenticated
  • Sad
@gloriousCode
Copy link
Collaborator Author

gloriousCode commented Dec 5, 2024

Two in a row! While I would have blamed the new monitorFrame this panic stack trace may be due to gemini:

^C[INFO]  | LOG | 05/12/2024 13:18:35 | Captured interrupt, shutdown requested.
[DEBUG] | LOG | 05/12/2024 13:18:35 | Engine shutting down..
[DEBUG] | ORDER | 05/12/2024 13:18:35 | Order manager shutting down...
[DEBUG] | PORTFOLIO | 05/12/2024 13:18:35 | Portfolio manager shutting down...
[DEBUG] | CONNECTION | 05/12/2024 13:18:35 | Connection manager shutting down...
[DEBUG] | CONNECTION | 05/12/2024 13:18:35 | Connection manager stopped.
[DEBUG] | ORDER | 05/12/2024 13:18:35 | Order manager shutdown.
[DEBUG] | PORTFOLIO | 05/12/2024 13:18:35 | Portfolio manager shutdown.
[DEBUG] | DISPATCH | 05/12/2024 13:18:35 | Dispatch manager shutting down...
[DEBUG] | DISPATCH | 05/12/2024 13:18:35 | Dispatch manager shutdown
[DEBUG] | EXCHANGE | 05/12/2024 13:18:35 | Currency state manager shutting down...
[DEBUG] | EXCHANGE | 05/12/2024 13:18:35 | Currency state manager shutdown.
[DEBUG] | WEBSOCKET | 05/12/2024 13:18:35 | Gemini websocket: shutting down websocket
[DEBUG] | WEBSOCKET | 05/12/2024 13:18:35 | Gemini websocket: trafficMonitor shutdown message received
[DEBUG] | WEBSOCKET | 05/12/2024 13:18:35 | Gemini websocket: completed websocket shutdown
panic: sync: negative WaitGroup counter

goroutine 105 [running]:
sync.(*WaitGroup).Add(0x14000a7e000?, 0x2?)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/sync/waitgroup.go:64 +0x108
sync.(*WaitGroup).Done(...)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/sync/waitgroup.go:89
github.com/thrasher-corp/gocryptotrader/exchanges/gemini.(*Gemini).wsReadData(0x140003b2308)
	/Users/WIF/go/src/github.com/thrasher-corp/gocryptotrader/exchanges/gemini/gemini_websocket.go:209 +0x218
created by github.com/thrasher-corp/gocryptotrader/exchanges/gemini.(*Gemini).WsConnect in goroutine 146
	/Users/WIF/go/src/github.com/thrasher-corp/gocryptotrader/exchanges/gemini/gemini_websocket.go:71 +0xec
exit status 2

gbjk added a commit to gbjk/gocryptotrader that referenced this issue Dec 5, 2024
@shazbert shazbert linked a pull request Dec 5, 2024 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant