Conversation
…t verified The proxy create and re-verify endpoints run the multi-region DNS validator, write the rule as verifying and enqueue generation. The worker then ran the identical validator again seconds later: doubled DNS traffic when both pass, and when the second run failed on a transient it wrote unverified over a status the endpoint had just written. The certificate message now carries skipDomainValidation, set by every enqueuer that verified DNS itself, and the worker honours it. The renew check stays in place, unlike a forced job. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
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.
Option 1 of two: the explicit variant. Option 2 is cloud-only (appwrite-labs/cloud#5963) and infers the same thing from the rule's status. One of the two will be kept.
Problem
The proxy create endpoints and the re-verify endpoint run the multi-region DNS validator, write the rule as
verifying, and enqueue generation. Seconds later the certificates worker ran the identical validator again. When both pass, that is doubled DNS traffic and latency for nothing. When the second run fails on a transient, the worker writesunverifiedwith "DNS verification failed" on a rule the API just accepted, and the console contradicts itself. That flip is the only outcome the second check can produce that the first could not.Change
Appwrite\Event\Message\CertificategetsskipDomainValidation, defaultfalse, serialized with the rest. Jobs already in the queue when this ships carry no key and behave as before.validateDomainwhen the flag is set. UnlikeskipRenewCheck, the renew check stays in place, so an existing certificate is still reused rather than re-issued. That distinction matters for self-hosted Let's Encrypt, where a needless re-issue counts against rate limits.verifying, the re-verify endpoint, and the worker's own domain-verification action when it hands off to generation.Not set by maintenance renewals, the SSL task, the main-domain bootstrap, or the auto-issue path for Appwrite-owned subdomains, none of which verified anything first. The worker's DNS check still runs for all of them.
If the DNS really did change between the endpoint's check and the job, the provider's own challenge does not complete and the status stays pending; nothing is issued for a domain that does not point at the instance.
Tests
tests/unit/Event/Message/CertificateTest.php: the flag round-trips through the queue payload with the renew check untouched, and a payload from before the flag reads asfalse.tests/unit/Workers/CertificatesDomainValidationTest.phpdrives the worker's public action with a domain under a TLD no public suffix list knows, which the DNS check refuses before touching the network, so the tests observe whether the check ran: with the flag the job reachesissueCertificateand the rule staysverifying; with the flag and no renewal needed nothing is issued and the rule still staysverifying; without the flag the job never reaches issuance and the rule is writtenunverified.composer lintpasses. PHPStan passes on the touched files (the fullcomposer analyzeexceeds Composer's process timeout on this machine). Tests were not run locally.🤖 Generated with Claude Code