Repository navigation
Conversation
|
Nice catch, and a clean fix — verified on the current head.
Checks all green on this head (Backend Hermetic Merge Gate, Backend unit suite, Listen Pusher Stack Gauntlet, Hermetic Backend E2E, Hygiene, Formatting). Leaving formal approval to the maintainers; from an automated review standpoint this looks merge-ready as-is. 🤖 Automated review on behalf of the maintainers. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
get_audio_bytes_webhook_seconds in the pusher webhook handler now goes through run_blocking on db_executor, matching the three adjacent lookups in the same block that were already offloaded (Fixes #15290), closing the last blocking DB call in that handler. AST-guard test + full pusher/webhook suite green. Confidence 5/5.
Fixes #15290
One line:
get_audio_bytes_webhook_secondsnow goes throughawait run_blocking(db_executor, ...), matching the three lines directly below it in the same block.db_executoris the pool the adjacent calls already use, andpusher.pyalready imports both names.Tests:
backend/tests/unit/test_pusher_webhook_lookup_offload.py. It asserts the handler is async, that the lookup is not called directly, that it is offloaded through an awaitedrun_blockingondb_executor, and that the two adjacent lookups stay offloaded, so the guard also catches someone removing their offload later.Verification:
Five existing tests monkeypatch this symbol on the pusher module with a plain
lambda uid: None. That keeps working, becauserun_blockingresolves the module global at call time and runs it in a thread, but I ran them rather than assuming:The 59 pusher, webhook, listen and trigger suites give an identical result on this branch and on
c385444b72: the same two files fail on both (test_verify_pusher_config_references.py,test_verify_pusher_promotion_evidence.py, which check rendered k8s manifests and fail locally for environment reasons), and nothing else.With
routers/pusher.pyreverted to its state on main and the test kept, 2 of the 4 fail; the two that still pass are the handler-is-async check and the adjacent-lookups check, both true on main.pusher.pydoes not change line count.Product invariants affected
none
Failure class (fixes)
Failure-Class: none