انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهMID-033-L03

إعادة المحاولة والتراجع التدريجي والعشوائية (Jitter)

  • الدرس 3 من 8
  • Mid-level
في هذا الدرس 4 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

retry safely and without synchronizing clients.

الموضوعات المخطط لها

  • Retry only transient failures (timeouts, 503, connection reset) on idempotent operations.
  • Never retry non-idempotent POSTs unless protected by an idempotency key.
  • Exponential backoff: wait 100 ms, 200 ms, 400 ms, with a cap and a maximum attempt count.
  • Jitter: add randomness so clients do not all retry at the same moment.
  • Retries only inside the latency budget; a retry budget (for example at most 10% extra calls) limits storms.
تفاصيل المخطط المبدئي

عرض عملي

java
RetryConfig cfg = RetryConfig.custom()
    .maxAttempts(3)
    .intervalFunction(IntervalFunction.ofExponentialRandomBackoff(100, 2.0, 0.5))
    .retryExceptions(IOException.class, TimeoutException.class)
    .build();

اختبر فهمك

Why add jitter?

أظهر الإجابة

To stop all clients retrying at the same instant and re-overloading the service.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.