Skip to content

Thread pool dies and does not recover #183

Closed
@0xtavian

Description

@0xtavian

Thread pool dies and does not recover

I’ve encountered an issue where Interlace’s thread pool gradually dies off and never recovers, eventually slowing down execution to a crawl (only a couple of threads left running) — even when commands do not crash.

Reproduction Steps

  1. Create a large list of targets:

    seq 1 1000000 | sed 's/^/example-/' > targets.txt
  2. Create a minimal script called crashy.sh (no crash, just sleep):

    #!/bin/bash
    sleep 2
  3. Make it executable:

    chmod +x crashy.sh
  4. In one terminal, sleep for 2 secs and then start monitoring thread activity:

    sleep 2 ; top -H -p $(pgrep -fa interlace | cut -d ' ' -f1)
  5. In a second terminal, quickly run:

    interlace -tL targets.txt -c './crashy.sh _target_' -threads 15
  6. Optionally, monitor active subprocesses:

    ps aux | grep ./crashy.sh | wc -l

Observed Behavior

  • Interlace starts with the expected number of threads (-threads 15).
  • Over time, the number of active threads drops.
  • Threads are not restarted, even though the commands are completing successfully.
  • It doesn't seem like all threads die off but many of them do, slowing down progress to a crawl.

Expected Behavior

  • Interlace should maintain the requested concurrency level until all tasks are completed.
  • Completed or idle threads should be reused or restarted as needed.

Let me know if I can help test any fix or branch!

@codingo @prodigysml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions