(refactor) disable listen for subscriptions for Bitfinex #6841
+7
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before submitting this PR, please make sure:
A description of the changes proposed in the pull request:
The following method (
listen_for_subscriptions
) is inherited but it's inner dependencies are not implemented in Bitfinex connector, thus it's permanently erroring ("Unexpected error occurred when listening to order book streams. Retrying in 5 seconds...").hummingbot/hummingbot/core/data_type/order_book_tracker_data_source.py
Lines 70 to 91 in cdfc1f8
Moreover, it's not only error messages that is annoying, but somehow, it causes CPU utilization to max out and break the bot after several hours. I suspect the root cause is the execution logic repeatedly entering
listen_for_subscriptions
and repeatedly throwing an exception. Seems like a busy-wait issue.By disabling the execution of
listen_for_subscription
for Bitfinex, I observed the CPU max-out problem disappear (given that there are no other error message spamming). Moreover, disabling this function seems to cause zero negative effect since the Bitfinex logic does not requirelisten_for_subscription
.Previously, I tried to implement this function instead of disabling it, but I haven't received adequate support from the team, and without pull request reviews, I was not able to complete it. @yancong001 tipped the idea of disabling the function instead, so I tried it.
Tests performed by the developer:
After disabling the function, the CPU max-out problem disappeared, given that there was no other error spamming. To test, I run PMM on Bitfinex in a Digital Ocean droplet with 4 vCPUs and 8GB of RAM for 3 days. As opposed to v1.23.0, which almost always crashes within the first day, this fork run smoothly for 3 days and counting.
Tips for QA testing:
Run PMM on Bitfinex, compare the latest release versus this fork, and observe CPU utilization.
Fixes #5919.