Closed
Description
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
-
Create a large list of targets:
seq 1 1000000 | sed 's/^/example-/' > targets.txt
-
Create a minimal script called
crashy.sh
(no crash, just sleep):#!/bin/bash sleep 2
-
Make it executable:
chmod +x crashy.sh
-
In one terminal, sleep for 2 secs and then start monitoring thread activity:
sleep 2 ; top -H -p $(pgrep -fa interlace | cut -d ' ' -f1)
-
In a second terminal, quickly run:
interlace -tL targets.txt -c './crashy.sh _target_' -threads 15
-
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!
Metadata
Metadata
Assignees
Labels
No labels