Skip to content

feat(deposition): retry assembly creation failures due to FTP login e…#6196

Open
anna-parker wants to merge 2 commits intomainfrom
retry_login_error_ena
Open

feat(deposition): retry assembly creation failures due to FTP login e…#6196
anna-parker wants to merge 2 commits intomainfrom
retry_login_error_ena

Conversation

@anna-parker
Copy link
Contributor

@anna-parker anna-parker commented Mar 26, 2026

…rror

resolves #

Screenshot

PR Checklist

  • All necessary documentation has been adapted.
  • The implemented feature is covered by appropriate, automated tests.
  • Any manual testing that has been done is documented (i.e. what exactly was tested?)

🚀 Preview: Add preview label to enable

@claude claude bot added the deposition related to ENA/INSDC deposition label Mar 26, 2026
@anna-parker anna-parker marked this pull request as ready for review March 26, 2026 14:12
@claude
Copy link
Contributor

claude bot commented Mar 26, 2026

Claude finished @anna-parker's task in 2m 37s —— View job


Code Review

  • Gather context and read changed files
  • Review code quality, error handling, and logic
  • Check for security, performance, and testing concerns
  • Post inline comments and final summary

The PR is a clean, focused change. The rename from trigger_retry_if_existsretry_failed_submissions_for_matching_errors is a clear improvement in naming, and generalising the parameter from a single error_substring to error_substrings is the right design to support the new FTP login error case.

Key observations:

  • No tests. There are no unit tests for retry_failed_submissions_for_matching_errors (old or new). The checklist item is unchecked — the new any()-based matching logic is simple but worth covering, especially to guard against the Iterable[str] footgun noted in the inline comment.
  • Behaviour is backward-compatible for create_project.py and create_sample.py: they don't pass error_substrings, so they still use the ("does not exist in ENA",) default.
  • Only assembly retries on the FTP login error, which is correct — project and sample creation use HTTP (not webin-cli/FTP), so they shouldn't be affected by this class of error.

Inline comments left on:

  1. ena_submission_helper.py:886Iterable[str] type safety (passing a bare str would silently match characters)
  2. create_assembly.py:763–767 — trailing : in the auth error substring worth confirming against a real ENA error output
  3. create_assembly.py:761 — no max retry cap for persistent auth failures (pre-existing gap, but worth noting)

table_name: TableName,
retry_threshold_min: int,
error_substring: str = "does not exist in ENA",
error_substrings: Iterable[str] = ("does not exist in ENA",),
Copy link
Contributor

Choose a reason for hiding this comment

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

The type Iterable[str] is a subtle footgun here: a plain str is also Iterable[str], so passing "some error" accidentally instead of ("some error",) would silently iterate over individual characters. Consider narrowing to Sequence[str] or tuple[str, ...] to make the interface safer.

Comment on lines 763 to +767
db_config,
table_name=TableName.ASSEMBLY_TABLE,
retry_threshold_min=config.retry_threshold_min,
last_retry=last_retry_time,
error_substrings=(
Copy link
Contributor

Choose a reason for hiding this comment

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

The first substring ends with "user error.:" — the trailing colon after the full stop looks unusual. Is this literally what ENA returns in the error message? If the colon is part of the actual message (e.g. preceding a stack trace), the match is fine, but it's worth confirming against a real example so the substring doesn't silently stop matching if ENA changes formatting.

messages.append(msg)

last_retry_time = trigger_retry_if_exists(
last_retry_time = retry_failed_submissions_for_matching_errors(
Copy link
Contributor

Choose a reason for hiding this comment

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

The FTP auth retry will loop indefinitely for persistent credential failures — only the retry_threshold_min cooldown limits frequency, but there's no max attempt count. This pattern already exists for the "does not exist in ENA" case, so it's not a new regression, but it means a persistent misconfiguration will keep retrying forever without alerting. The TODO on line 774 acknowledges this gap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deposition related to ENA/INSDC deposition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant