fd-leak-diagnosis

Diagnose file descriptor leaks across system, process, FD type, and code levels.

3|2|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/openeuler-mirror/witty-diagnosis-agent --skill fd-leak-diagnosis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fd-leak-diagnosis
Source: https://github.com/openeuler-mirror/witty-diagnosis-agent/tree/main/skills/fd-leak-diagnosis
Command: npx skills add https://github.com/openeuler-mirror/witty-diagnosis-agent --skill fd-leak-diagnosis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires bash, lsof, ss, strace, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill resolves system instability and application crashes caused by file descriptor (FD) exhaustion, such as Too many open files or CLOSE_WAIT accumulation, by providing a systematic, multi-layer diagnostic path.

Core Features & Use Cases

  • Four-Layer Analysis: Automatically drills down from system-wide FD limits to specific process-level leaks, FD type classification, and code-level root cause identification.
  • Automated Branching: Dynamically selects specialized diagnostic scripts based on initial baseline findings (e.g., socket, epoll, inotify, or system-level leaks).
  • Use Case: When a production service reports intermittent connection failures, use this skill to pinpoint whether the issue is a socket leak in the connection pool or an unclosed file handle in the logging module.

Quick Start

Run the fd-leak-diagnosis skill to analyze the current file descriptor usage for the process with PID 1234 and identify the root cause of the leak.

Frequently Asked Questions about fd-leak-diagnosis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I diagnose file descriptor exhaustion and CLOSE_WAIT accumulation in Linux?

Diagnose file descriptor leaks by running an automated multi-layer analysis that drills down from system-wide FD limits to specific process-level leaks, classifies FD types, and identifies the root cause of CLOSE_WAIT accumulation.

Why does my production service report Too many open files intermittently?

Too many open files errors occur because a file descriptor leak exists, which this skill pinpoints by dynamically selecting specialized diagnostic scripts to trace whether the issue is a socket leak, epoll instance leak, or an unclosed file handle.

What's the best way to troubleshoot epoll instance leaks and inotify watch limits?

Troubleshoot epoll instance leaks and inotify watch limits using an evidence-based diagnostic path that automatically branches into specialized analysis based on initial baseline findings of FD usage.

Do I need lsof and strace to perform root cause analysis on FD leaks?

You need lsof and strace because this skill depends on them, alongside bash and ss, to execute its multi-layer diagnostic scripts and perform automated root cause analysis for FD leaks in Linux environments.

Can I identify a specific unclosed file handle in a logging module using automated diagnosis?

You can identify an unclosed file handle in a logging module using this skill's code-level root cause identification, which automatically drills down from process-level FD classification to pinpoint the exact leak source.