Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIGitHub CopilotGitHub CopilotGemini CLIGemini CLI+20 more

    Repair Semaphore Permit Leaks

    1

    Repair semaphore permit leaks and over-release bugs across exceptions, cancellation, timeouts, task submission, and shutdown.

    $8.99

    Secure checkout via Stripe

    30-day refund guarantee

    Converts to your local currency at checkout

    0 installsSecurity scanned
    Repair Semaphore Permit Leaks

    Repair Semaphore Permit Leaks

    Example session with this skill installed

    Our Java ingestion service acquires a fair Semaphore before submitting work to an ExecutorService. If execute() rejects the task or cancellation wins before the worker starts, the callback that normally releases the permit never runs. After repeated deploy drains, all permits disappear and new requests block. Repair locally with a fake executor and deterministic barriers. Preserve the permit count, fairness, queue policy, timeout values, and retry behavior; do not touch production workers.

    • Read your context and instructions
    • Compiled the repair semaphore permit

    Permit leak found. The request acquires before task submission, but executor rejection bypasses the callback that normally releases it. The repair assigns ownership immediately after successful acquire, transfers it only after accepted submission, funnels all terminal paths through one guarded release, and validates rejection, cancellation, timeout, and duplicate-cleanup orderings with deterministic barriers.

    Connects securely to your tools. The creator never sees your data.

    What you get

    Eliminate resource exhaustion caused by stranded concurrency permits.Fix race conditions between task cancellation and permit acquisition.Resolve ambiguity in weighted semaphore partial-acquisition failures.Implement deterministic testing for concurrency-related drift.

    About this skill

    The problem

    Concurrency gates often fail silently when semaphores leak permits after exceptions or cancellations. This leads to services that gradually stop accepting work despite having idle resources or, conversely, exceeding configured limits.

    What it does

    • Identifies every semaphore instance and guarded resource across the codebase.
    • Reconstructs permit ownership timelines for success, timeout, and cancellation paths.
    • Repairs acquisition/release symmetry to ensure every permit has exactly one terminal disposition.
    • Fixes partial-failure cleanup in weighted/multi-permit acquisition logic.
    • Implements idempotent, owner-aware release mechanisms without altering business retry logic.

    Why this beats prompting it yourself

    General LLMs often suggest simple try-finally blocks that fail during complex race conditions or async cancellations. This skill uses a strict conservation invariant and permit-ownership registry to ensure logic is mathematically sound across all possible failure states.

    Use cases

    • Fixing services that eventually hang or "freeze" under high load.
    • Ensuring worker pools don't exceed memory limits due to double-releases.
    • Hardening async task submissions where permits are stranded on submission failure.
    • Converting sleep-based race tests into deterministic concurrency barriers.

    Known limitations

    Does not modify global infrastructure settings like external load balancer capacity. Requires repository access to inspect local synchronization primitives.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean 1 month ago

    • Passed all security checks, Safe to install

    Listed1 month ago

    What's inside

    Frequently Asked Questions