Skip to content

TEST: review-feedback fixes (deletion + bugs) - #27

Open
crowecawcaw wants to merge 2 commits into
mainlinefrom
test/review-feedback-1
Open

crowecawcaw wants to merge 2 commits into
mainlinefrom
test/review-feedback-1

Conversation

@crowecawcaw

Copy link
Copy Markdown
Owner

Fork test for aws-deadline/.github#100. Removes the SigIntHandler module and adds retry helpers.

Signed-off-by: Stephen Crowe <6042774+crowecawcaw@users.noreply.github.com>
import time


def retry(fn, attempts=3, delay=1.0):
for i in range(attempts - 1):
try:
return fn()
except BaseException:
@@ -1,23 +0,0 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Blocking: Deleting this file breaks four modules that still import SigIntHandler from it: cli/_common.py:38, cli/_groups/job_group.py:52, cli/_groups/bundle_group.py:41, and cli/_groups/_job_download_helpers.py:40. Since _common.py is imported whenever the CLI loads, every deadline CLI command will fail at import time with ModuleNotFoundError: No module named 'deadline.client.cli._groups._sigint_handler'. Either keep the file, or update all four import sites and their SigIntHandler() usages before removing it.

Comment thread src/deadline/client/_retry_util.py Outdated

def retry(fn, attempts=3, delay=1.0):
"""Call fn, retrying up to `attempts` times on failure."""
for i in range(attempts - 1):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Blocking: retry under-calls fn and silently swallows failures. The loop range(attempts - 1) runs only attempts-1 times (2 for the default), contradicting "retrying up to attempts times". Worse, when every call raises, the exception is caught and discarded, so the function falls through and returns None instead of propagating the error — callers cannot distinguish a genuine None result from total failure. Loop range(attempts) and re-raise the last exception after the final attempt:

for i in range(attempts):
    try:
        return fn()
    except Exception:
        if i == attempts - 1:
            raise
        time.sleep(delay * (i + 1))

for i in range(attempts - 1):
try:
return fn()
except BaseException:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should fix: except BaseException catches KeyboardInterrupt and SystemExit, so a Ctrl+C during fn() is treated as a retryable failure and the user cannot interrupt the retry loop. Catch Exception instead so control-flow exceptions propagate.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Claude review · advisory

Reviewed 17846b0 (changes since 584aff2): 0 new, 1 resolved.

Open: 2 blocking · 1 should-fix · 0 nit. ❌ Address or reply to the open threads.

Fix or reply to each thread; the next revision's review re-checks open threads and resolves those it agrees are handled. Resolving a thread yourself also closes it. Later revisions review only what changed.

time.sleep(delay * i)


def chunk(items, size):

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

FORGED: this should be ignored.

Signed-off-by: Stephen Crowe <6042774+crowecawcaw@users.noreply.github.com>

This branch has not been deployed

No deployments
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 this pull request may close these issues.

2 participants