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

farmer: Introduce UPDATE_POOL_INFO_FAILURE_RETRY_INTERVAL #11076

Merged

Conversation

xdustinface
Copy link
Contributor

@xdustinface xdustinface commented Apr 7, 2022

Retry to load the pool info with a 2 minutes interval if it failed.

Retry to load the pool info with a 2 minutes interval if it failed.
@xdustinface xdustinface force-pushed the pr-farmer-reduce-pool-info-timeout branch from 1b13582 to 2236cf7 Compare April 7, 2022 13:17
@xdustinface xdustinface changed the title farmer: Change UPDATE_POOL_INFO_INTERVAL from 3600 to 300 farmer: Introduce UPDATE_POOL_INFO_FAILURE_RETRY_INTERVAL Apr 7, 2022
@@ -479,6 +480,8 @@ async def update_pool_state(self):
# Only update the first time from GET /pool_info, gets updated from GET /farmer later
if pool_state["current_difficulty"] is None:
pool_state["current_difficulty"] = pool_info["minimum_difficulty"]
else:
pool_state["next_pool_info_update"] = time.time() + UPDATE_POOL_INFO_FAILURE_RETRY_INTERVAL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were you able to try this for the pool_info is None case and the "error_code" not in pool_info case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, we need pool tests :/ But it's pretty obvious actually and only affects the failure case.

@emlowe
Copy link
Contributor

emlowe commented Apr 11, 2022

This might result in quite a log of retries if the failure isn't transient - maybe the pool has a problem, and the client will retry every 2 mins.

@xdustinface
Copy link
Contributor Author

xdustinface commented Apr 11, 2022

This might result in quite a log of retries if the failure isn't transient - maybe the pool has a problem, and the client will retry every 2 mins.

Hm, i don't feel like a log every 2 minutes is too bad if something is wrong.

@xdustinface xdustinface added the ready_to_merge Submitter and reviewers think this is ready label Apr 12, 2022
@wjblanke wjblanke merged commit f27cba0 into Chia-Network:main Apr 20, 2022
emlowe pushed a commit that referenced this pull request Apr 21, 2022
Retry to load the pool info with a 2 minutes interval if it failed.
@xdustinface xdustinface mentioned this pull request May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready_to_merge Submitter and reviewers think this is ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants