المهلات وكشف التسرّب
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
configure timeouts that fail fast, and find leaks.
الموضوعات المخطط لها
connectionTimeout: how long a thread waits for a connection (a few seconds, not 30 s default for APIs; verify default).- Database side:
statement_timeout,lock_timeout,idle_in_transaction_session_timeout. - A leak is a borrowed connection never returned;
leakDetectionThresholdlogs a stack trace when one is held too long. - Pool exhaustion signs: threads blocked in
HikariPool.getConnectionin thread dumps,pendingthreads metric above zero. - Do not hold a connection across remote calls;
spring.jpa.open-in-viewcan hold one for a whole request (consider turning it off).
تفاصيل المخطط المبدئي
عرض عملي
a thread dump excerpt with many threads waiting in HikariPool.getConnection.
اختبر فهمك
What does leakDetectionThreshold report?
أظهر الإجابة
A stack trace for connections held longer than the threshold.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.