Connection leak xảy ra khi ứng dụng mở connection mà không đóng (phổ biến trong framework có connection pool).
Channel leak tương tự.
Triệu chứng: số connection/channel tăng dần, cạn kiệt file handle, connection mới bị reject.
Phòng ngừa:
- Dùng connection pooling;
- Dùng try-finally hoặc try-with-resources để đảm bảo gọi close();
- Monitor và alert khi count tăng;
- Set heartbeat timeout để phát hiện dead connection;
- Giới hạn connection per application
Debug bằng management UI xem IP/user nào đang leak.
Connection leaks occur when apps open connections without closing them.
- Symptoms: growing connection/channel count, exhausted file handles, new connections rejected.
- Prevention: use connection pooling, try-finally for guaranteed close(), monitor and alert on growing counts, set heartbeat timeout to detect dead connections, implement per-app connection limits.
- Debug by checking which IP/user is leaking in the management UI.