Skip to content

fix(certificates): stop reporting a retryable certificate failure as a worker error - #14125

Merged
HarshMN2345 merged 1 commit into
mainfrom
fix-certificate-retry-errors
Oct 5, 2026
Merged

HarshMN2345 merged 1 commit into
mainfrom
fix-certificate-retry-errors

Conversation

@HarshMN2345

@HarshMN2345 HarshMN2345 commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Since #14009 and #14117, the certificate worker checks a delayed provider's status when it revisits a rule that is still generating. When the provider is waiting on the domain owner, for example a Fastly authorization that needs a DNS record the owner has not added, getCertificateStatus() throws. The worker then correctly keeps the rule generating for another attempt, but it still rethrows. So every interval retry of such a domain is reported as a worker error: one error per domain roughly every 5–7 minutes, until the fifth attempt.

That is an expected wait, not a failure of the worker. This PR logs it with Console::warning and lets the interval retry, the same way the domain-verification step in this worker already handles its own retryable failure. Only the terminal case is still rethrown: when the rule goes to unverified and the security mail is sent.

Nothing else changes. The rule's logs still carry the provider's message, including the DNS records the owner has to add, attempts still count, and the fifth failure still marks the rule unverified and mails.

Test Plan

  • php -l and Pint on the changed file.
  • tests/unit/Workers/CertificatesDomainValidationTest is unaffected: it catches whatever the worker throws and asserts only the records written.
  • On an environment with Fastly: a custom domain whose DNS does not point at Fastly stays on generating with the Fastly instructions in its logs, produces no worker error until the fifth attempt, and then goes to unverified with one mail.

Related PRs and Issues

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

…a worker error

A delayed provider's failure that keeps the rule generating for another attempt was still rethrown, so every interval retry of a domain waiting on its owner's DNS records reached the error tracker. Log it and let the interval retry; only the final failure, which marks the rule unverified and mails, is rethrown.
@ghost

ghost commented Oct 5, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The certificate worker now logs retryable delayed-provider failures as warnings instead of rethrowing them. Terminal failures still mark the rule failed, send the security notification, and throw; persistence remains in the existing finally block.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 1
File Change
src/Appwrite/Platform/Workers/Certificates.php Suppresses worker exceptions while delayed-provider retries remain and adds a warning.

Reviewed 6f2b345 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Tier A · Looks good to merge. Summary

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → fix-certificate-retry-errors (after).

Metric Before After Change
🚀 Requests/sec 194.21 200.66 ⚪ +3.3%
⏱️ Latency P50 90.25 ms 87.38 ms ⚪ -3.2%
⏱️ Latency P95 209.71 ms 200.94 ms ⚪ -4.2%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 87.38 200.94 12,540 200.66 -8.77
Account 164.7 315.54 660 11.08 +4.32
TablesDB 85.13 162.59 6,820 111.08 -1.75
Storage 77.16 169.25 3,300 55.81 -17.3
Functions 123.58 242.25 1,760 30.5 -6.04

Top API waits (after)

API request Max wait (ms)
functions.variables.update 453.9
tablesdb.rows.update 417.38
account.name.update 416.31
functions.create 411.79
tablesdb.rows.delete 409.39

@HarshMN2345
HarshMN2345 merged commit 8379170 into main Oct 5, 2026
55 checks passed
abnegate added a commit that referenced this pull request Oct 5, 2026
Merges main a2cca78 (#14009, #14106, #14117, #14115, #14119, #14114,
#14101, #14125, #14129, #14127) so cloud#5410 can require a train head
that contains main at or after 0ed7232.

Conflicts: none.

Database 8.0 port: none needed. Main's new code only uses Document
getAttribute/setAttribute and Query::equal/lessThan/orderAsc/limit
(Tasks/Interval.php), all unchanged in database 8.0; no removed
Database::* constants, config collections, or model magic reads.
composer.json and composer.lock are untouched by main, so the train's
database and migration pins stay as they are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

1 participant