Bound all external process calls with a timeout and forced termination
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- java
- Bereich
- operating-systems
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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).
- Vorherrschende Sprache
- Java
- Sterne
- 6
- Forks
- 6
- Ø Merge
- 10 Std. 11 Min.
- Gemergte PRs (30 T.)
- 12
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus JDiskMark/jdm-java
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement linux
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
Maintainer antworten meist innerhalb von 1 Tag
-
documentation linux
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement linux
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug linux
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 52/100
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in JDiskMark/jdm-java
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
bloxbean/yaci-store#1445 ·
Maintainer antworten meist innerhalb von 1 Tag
-
图片灯箱过长的话底部carousel滑动没有惯性Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
-
Spare PermissionOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 63/100
Etar-Group/Etar-Calendar#2234 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG] MCP resources-as-tools drops invocation context when listing templatesEvtl. vergeben @CryoThrust hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
langchain4j/langchain4j#7320 ·
Maintainer antworten meist innerhalb von 1 Tag