Bound all external process calls with a timeout and forced termination
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- java
- Domaine
- operating-systems
Piste de recherche
Start with UtilsLinuxOs.getWholeDisks, which already uses the CompletableFuture drain, waitFor(timeout) and destroyForcibly pattern, and compare it with the unbounded calls in UtilsLinuxOs.getPartitionFromFilePath, UtilsMacOs and UtilOs.runPowerShellOneLiner. Before writing code, settle where the shared runCommand helper should live, since the issue leaves that open. Done means every ProcessBuilder call site is bounded and force-destroyed on timeout, returns null or an empty list, and logs a warning.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Background
PR #254 (#252) added proper timeouts to the USB VID/PID lookups on Windows
(UtilsWinOs.getUsbIds, 15 s) and macOS (UtilsMacOs.runCommandLines, 10 s):
output is drained asynchronously, waitFor(timeout) is honoured, and the child
is destroyForcibly()'d on expiry. Review feedback (Copilot) flagged that the
remaining process calls do not follow this pattern.
Problem
Many ProcessBuilder call sites either:
- call
process.waitFor()with no timeout, or - read stdout to EOF with
readLine()before callingwaitFor(n, SECONDS),
making the timeout ineffective, and never destroy the child.
A hung child (stale network mount for df, stalled DiskArbitration for
diskutil, slow/broken WMI for PowerShell) can block drive detection,
benchmark setup, or the UI indefinitely.
Affected call sites (non-exhaustive)
UtilsLinuxOs.getPartitionFromFilePath(df -k),waitFor()without a timeoutUtilsLinuxOs.getDeviceNamesFromPartition(lsblk -no pkname),waitFor()without a timeoutUtilsMacOs:df -k,diskutil info(lines ~92, ~153),system_profiler,
the generic command runner (~208),mount(~318)UtilOs: remainingwaitFor()calls with no timeout (Linux SMART/lsblk/udevadm helpers) and
read-then-waitFor(n)PowerShell helpers (e.g.runPowerShellOneLiner)
Proposed approach
- Use the existing pattern from
UtilsLinuxOs.getWholeDisks:
CompletableFutureoutput drain →waitFor(timeout)→destroyForcibly()infinally. - Consider one shared helper (e.g.
runCommand(timeout, String... cmd) → List<String>)
so call sites stay consistent. Confirm package/location before adding. - Timeouts: 10 s for native tools, 15 s for PowerShell (start-up + WMI).
- On timeout: log at WARNING and return the existing "unavailable" value
(null/empty list) so detection failures never block a benchmark.
Priority
Low–medium. Hangs are rare on Linux (sysfs/statfs), more plausible on macOS
(diskutil) and Windows (PowerShell/WMI).
- Langage dominant
- Java
- Étoiles
- 6
- Forks
- 6
- Merge moyen
- 10 h 11 min
- PR mergées (30 j)
- 12
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de JDiskMark/jdm-java
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
Les mainteneurs répondent en général sous 1 jour
-
enhancement linux
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
Les mainteneurs répondent en général sous 1 jour
-
documentation linux
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Publish JDiskMark on FlathubOuverteenhancement linux
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
Les mainteneurs répondent en général sous 1 jour
-
bug linux
Difficulté 3/5 1-2 jours Accessibilité débutants 52/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de JDiskMark/jdm-java
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
bloxbean/yaci-store#1445 ·
Les mainteneurs répondent en général sous 1 jour
-
图片灯箱过长的话底部carousel滑动没有惯性Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
-
Spare PermissionOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 63/100
Etar-Group/Etar-Calendar#2234 ·
Les mainteneurs répondent en général sous 1 jour
-
[BUG] MCP resources-as-tools drops invocation context when listing templatesPeut-être pris @CryoThrust l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
langchain4j/langchain4j#7320 ·
Les mainteneurs répondent en général sous 1 jour