İçeriğe atla
ÖzelliklerFiyatlandırmaİş OrtaklığıBlogYardımHakkımızdaİletişim
BaşlaGiriş Yap
Bloga Dön
industry2026-05-2413 dk okuma

At-risk alert gelmedi mantar stoku bittik — inventory-predict cron claim leak (PR #606 CCC F1)

Ayvalik Cunda Marmara Cad 45-yas "Ayvalik Kofte + Deniz" sahibi Mert 18 yillik Ege deniz mahsulleri restoran 65-cover hafta sonu turistik. thMenu Pro+ 14 ay daily 09:30 ingredient-reorder-alert + 07:00 inventory-predict cron Apple Watch at-risk push notifications. Cuma 08:30 sef Cemal "deniz mahsullu dolma mantar bitiyor hala gelmedi" haber verdi. Mert saskin son 3 gun tek inventory push yok. Normalde 2-3 stok alert/gun. Engineering cron_idempotency_claims sorgu Mert restaurant_id son 7 gun: Pazartesi 05-19 07:00 UTC inventory-predict:mert:2026-05-19 INSERT claimed_at set released_at NULL. Sali-Carsamba-Persembe-Cuma 07:00 fresh claim attempt existing row changes=0 cron skip. 5 gun arka arkaya inventory-predict skip Apple Watch buzz yok. Wrong theory: Cloudflare cron tetiklenmedi mi? Workers tail logs Pazartesi 07:00 [BEACON:cron_fired] log var Cron error AbortError timeout 5sn aiResponse fetch throw runCronSafe try/catch swallow log+return ama claim release edilmedi. cron_idempotency_claims pattern at-least-once dedup INSERT OR IGNORE claim winner side-effect fire pattern dogru calisir SADECE side-effect basarili ise. res.ok=false handled — release branch existing kod res.ok=false yakaliyor. fetch throw (AbortSignal.timeout network blip DNS fail) outer try/catch swallow release branch tetiklenmiyor claim 24+h tutulu. Pattern: claim acquisition before side-effect call → fetch attempt → success ise predictions + push fan-out / res.ok=false ise releaseClaim + return / throw ise control flow throw branch function exit exception outer runCronSafe yakaliyor log+return RELEASECLAIM ASLA CAGRILMIYOR. Mert in case 5 gun consecutive AI inference timeout 5 gun consecutive claim leak. **PR #606 batch CCC F1** fix sade: side-effect call (fetch AI inference) inner try/catch ile sarilmis: `let aiResponse = null; try { aiResponse = await fetch(...); } catch (err) { await releaseClaim(env, claimKey); throw err; }`. Throw branch releaseClaim cagirir claim revert re-throw outer runCronSafe log eder sonraki tick claim available cron tekrar fire eder. Bonus Sentry [BEACON:inventory_predict_fetch_throw] beacon 5+ throw/saat threshold PagerDuty sustained throw upstream AI service problem. Backfill: Mert icin manuel inventory-predict reset+replay 5-gun leaked claims DELETE manual cron fire AI current state mantar+4 baska at-risk push gonderildi. Platform-wide audit released_at IS NULL AND claimed_at < now-24h orphan leaked claims: **7 affected restaurant 23 leaked-day total**. Reset+replay each. Proactive email + 1-ay Pro tier credit. Mert Hall of Fame "helped harden cron claim symmetry". Aitor Bilbao Casco Viejo "Pintxos del Mercado" 38-cover Basque pintxos bar Ribera Market yakini version ayni flow cèpe mushroom. Pattern: **claim-before-side-effect pattern inde side-effect call (fetch r2.put kv.put getEnv) inner try/catch ile sarilmali throw da releaseClaim + re-throw cagrilmali. Outer runCronSafe sadece sync failure yakalar her path te release call edilmiyorsa claim 24h+ leak cron skip side-effect (alert/notification) hic fire etmez.** Implementation checklist: (1) acquire claim before side-effect; (2) side-effect inner try/catch; (3) throw releaseClaim + re-throw; (4) symmetric coverage every await external; (5) test simulate AbortSignal.timeout assert release+retry; (6) Sentry [BEACON:cron_fetch_throw] alert 5+/hour; (7) quarterly orphan-claim audit released_at NULL claimed_at <now-24h; (8) sibling cron sweep postback dispatcher cache-purge image-proxy custom-domain-reverify DoH.

th

thMenu Ekibi

thmenu.com

Faydalı buldunuz mu? Paylaşın.