Repository navigation
Processing: redrawn bases charged, credit checks count pages, billing hears every finish (#199 leftovers) - #218
Merged
Merged
Conversation
ndbroadbent
force-pushed
the
processing-leftovers
branch
from
December 4, 2026 17:15
60e1537 to
cebe2ed
Compare
… billing hears a build finish even when its check fails (#199) - A document's base drawn again with the head's settings is a render the build made that none of its snapshots points at; the charge counted only renders its snapshots point at, so those pages were never charged. It now counts every render the build made. - The part-way credit check ran every 200 snapshots, so a build of long documents could compare thousands of pages past its credits. It now counts pages (a document's from its render). - finished() returned early when BuildChanged's dispatch failed (a forge that's down), so CreditsSpent (low-credit emails, automatic packs) never ran. Both run now, and the first error is returned.
The suite is one binary whose tests boot at once, each with its own pool of up to 10: a CI runner's threads asked Postgres for more than its 100 connections, and tests failed at boot with "pool timed out".
ndbroadbent
force-pushed
the
processing-leftovers
branch
from
December 4, 2026 17:50
cebe2ed to
a9f7903
Compare
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.
Leftovers from #199's review.
Redrawn bases charged: when a document's head renders differently (another engine, DPI or renderer version), its base is drawn again with the head's settings. That render is made by the head's build, but none of the build's snapshots points at it, and the charge query counted only renders its snapshots point at, so those pages were never charged. It now counts every render the build made (
made_by_build_id); renders handed to another build when this one stops are reassigned as before. Test:a_build_pays_for_the_base_it_drew_again, which fails on main (rendered_pages: 0).The credit check counts pages: the part-way check ran every 200 snapshots, so a build of long documents could compare thousands of pages past its credits. It now counts pages: a document counts one per page of its render, everything else one. A build overruns by at most 200 pages plus the document that crosses the line. No new test: the existing part-way test covers screenshots, and a document version needs rendered fixtures. Happy to add one if you want it.
finished(): it returned early when
BuildChanged's dispatch failed (a forge that's down), soCreditsSpent(the low-credit emails, automatic packs) never ran. Both run now, and the first error is returned.Test pools (sc-9385): each test's pool holds at most 4 connections (
DB_MAX_CONNECTIONSinapp::testing::configure). The suite is one binary whose tests boot at once, each with a pool of up to 10, and on the build pool tests failed at boot with "pool timed out" three times on 4 Dec. The full suite passes twice in a row locally with 4.No visual changes.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.