fix: an interrupted upload stops holding the pending cap after 20 idle minutes; a dropped part goes again, quiet 429s, one Sentry report (DTF-WEB-13/14/15)
All checks were successful
Build and deploy / Validate source (push) Successful in 1m7s
Build and deploy / Integration suite on a real stack (push) Successful in 8m2s
Build and deploy / Secret scan and release gate (push) Successful in 10s
Build and deploy / Publish images (push) Successful in 1m35s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-24 17:17:31 -03:00
parent 242a56aae8
commit a1fad7698a
4 changed files with 31 additions and 9 deletions

View File

@@ -79,6 +79,12 @@ def run():
assert error.code == 429, error
assert error.headers.get('Retry-After') == '15', error.headers
assert json.load(error)['detail'] == 'Muitos envios ao mesmo tempo. O site tenta de novo sozinho.'
# DTF-WEB-14: reservations left by interrupted uploads, idle for 20
# minutes, no longer hold the cap; the next start goes through.
with db.connect() as c:
c.execute("UPDATE dtf_local.uploads SET expires_at=now()+interval '30 minutes' WHERE id=ANY(%s)",
([UUID(uid) for uid in pending],))
pending.append(client.call('/uploads', {'name': 'PENDING-AFTER-IDLE.png', 'size': 1})['id'])
for uid in pending:
client.call(f'/uploads/{uid}', expected=200, method='DELETE')