Enforce retry limit on backup tasks - #1172
Merged
Merged
Conversation
| if b.status in (Backup.STATUS_PENDING, Backup.STATUS_IN_PROGRESS): | ||
| _fail_backup(b, task, reason) | ||
| return | ||
| except KeyError: |
| # Merge did not finish; leave the old backup intact. | ||
| ob.status = Backup.STATUS_COMPLETED | ||
| ob.write_to_db() | ||
| except KeyError: |
mxsrc
force-pushed
the
fix-sfam-2785
branch
2 times, most recently
from
July 13, 2026 09:40
0d3c86f to
49ad031
Compare
| for node in nodes: | ||
| time.sleep(constants.DEV_DISCOVERY_INTERVAL_SEC) | ||
| break | ||
| if node.status != StorageNode.STATUS_ONLINE or node.is_secondary_node: # pass |
| # Inline (serialized) execution; _process_restart_task never | ||
| # raises, so a crash in one task cannot escape to the outer | ||
| # `while True` and kill recovery of every other node. | ||
| _process_restart_task(task.uuid) |
| fut: Future = Future() | ||
| try: | ||
| fut.set_result(fn(*args, **kwargs)) | ||
| except BaseException as exc: # noqa: BLE001 - mirror pool semantics |
|
|
||
|
|
||
| def post_lvol_delete_rebalance(lvol): | ||
| def post_lvol_delete_rebalance(cluster, lvol): |
|
|
||
|
|
||
| def update_master_task(task): | ||
| def update_master_task(task, cl): |
mxsrc
marked this pull request as ready for review
July 13, 2026 11:41
Collaborator
There was a problem hiding this comment.
This file is not used and should be removed
Having the code execution at module load time prevents/complicates testing of the functions. This applies the idiomatic pattern of checking for `__main__`, which is only the case when executing the module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR fixes https://simplyblock.atlassian.net/browse/SFAM-2785. The backup retry logic did not enforce the maximum retry limit, this is addressed by the initial commit. The follow up commits introduce testing to avoid this issue for other task runners where possible, and converts the
simplyblock_core.servicessubmodules to not execute at import time, allowing them to be tested individually.Test failures seem to be coming from upstream, there's no real way to confirm this though.