حالة السّاغا والمهلات والسّاغا العالقة
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
keep sagas from hanging forever.
الموضوعات المخطط لها
- Store state, step, deadline, and attempt count in the orchestrator's database.
- A scheduled sweeper finds sagas past their deadline and triggers retry or compensation.
- Make every reply handler idempotent and ignore replies for a state that has moved on.
- Expose a stuck-saga metric and an admin way to retry or force compensation.
- Give each step its own timeout shorter than the overall one.
تفاصيل المخطط المبدئي
عرض عملي
SELECT id FROM order_saga
WHERE state NOT IN ('COMPLETED','FAILED') AND deadline < now()
FOR UPDATE SKIP LOCKED;اختبر فهمك
What triggers action when a reply never arrives?
أظهر الإجابة
A timeout sweeper acting on the saved deadline.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.