-
Notifications
You must be signed in to change notification settings - Fork 18
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
refactor: Use cleanup manager to unsubscribe web3 subscriptions #432
Conversation
d7e6c69
to
3fa2960
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work. Not sure if this is related, but I get the following output when existing a service (this is from solver):
C2024-11-18T15:22:22-05:00 ERR ../../../.asdf/installs/golang/1.22.6/go/src/runtime/asm_arm64.s:1222 > error starting listeners: cancel by context reconnect in 2 seconds
2024-11-18T15:22:22-05:00 ERR ../../../.asdf/installs/golang/1.22.6/go/src/runtime/asm_arm64.s:1222 > error starting listeners: cancel by context reconnect in 2 seconds
Unsubscribing
Unsubscribing
Unsubscribing
2024-11-18T15:22:22-05:00 ERR ../../../.asdf/installs/golang/1.22.6/go/src/runtime/asm_arm64.s:1222 > error starting listeners: cancel by context reconnect in 2 seconds
2024-11-18T15:22:22-05:00 ERR ../../../.asdf/installs/golang/1.22.6/go/src/runtime/asm_arm64.s:1222 > error starting listeners: cancel by context reconnect in 2 seconds
2024-11-18T15:22:22-05:00 ERR ../../../.asdf/installs/golang/1.22.6/go/src/runtime/asm_arm64.s:1222 > error starting listeners: cancel by context reconnect in 2 seconds
Unsubscribing
Unsubscribing
2024-11-18T15:22:22-05:00 ERR ../../../.asdf/installs/golang/1.22.6/go/src/runtime/asm_arm64.s:1222 > error starting listeners: cancel by context reconnect in 2 seconds
Unsubscribing
Seems like we're trying to restart listeners maybe one last time?
3fa2960
to
9b9ef55
Compare
It's related. We aren't properly handling cancellation when starting these subscriptions: Lines 52 to 64 in 52de132
We call |
* chore: Add unsubscribe helper * refactor: Use cleanup manager to unsubscribe
Summary
This pull request makes the following changes:
unsubscribeSub
helperThis pull request refactors our web3 subscriptions to unsubscribe using our cleanup manager.
Test plan
Add a temporary print line to the new
unsubscribeSub
helper function to confirm that it is called when exiting the process.Details
This change unsubscribes as a part of our clean up when we receive a cancellation signal.