Skip to content

fix(common): preserve shell completion and drain stderr - #19

Open
Hanabi9248 wants to merge 3 commits into
IvorySQL:IVYC_REL_5_STABLEfrom
Hanabi9248:codex/shell-timeout-start-failure
Open

Hanabi9248 wants to merge 3 commits into
IvorySQL:IVYC_REL_5_STABLEfrom
Hanabi9248:codex/shell-timeout-start-failure

Conversation

@Hanabi9248

@Hanabi9248 Hanabi9248 commented Oct 26, 2026 •

Copy link
Copy Markdown

Two ShellUtil process-completion paths need correction. execShellWithTimeout reports true when Runtime.exec throws IOException before starting a process. execShellSpaceParam(String[]) reads only stdout, so a child producing enough stderr blocks before it can exit.

Initialize the timeout helper result to false while retaining Process.waitFor(time, unit) semantics for launched processes, including nonzero exits. In the array helper, merge stderr into the existing reader with ProcessBuilder.redirectErrorStream(true), preserving argument boundaries and the real exit code. No production timeout or other executor change is added.

Validation uses the complete production ShellUtil and unchanged real ShellResult, compiled with Windows JDK25.0.4.101 --release 8, actual cached commons-lang3 3.10, slf4j-api1.7.30 and Lombok1.18.42. SLF4J has its standard NOP fallback on this focused classpath.

The original startup regression measured one baseline assertion failure and two passing controls, then three passes for the accepted startup fix. That source hunk and runner remain unchanged and were not rerun for the stderr increment.

For the stderr increment, published head f3b0c61 is the baseline: two large-stderr cases reach their private child watchdog exit99 instead of expected exit0/7; three stdout/nonzero/space-containing-argument controls pass. With the additional one-line fix, all five new cases pass. Real finite child output is 512KiB; each child watchdog can halt only itself after8seconds. No Process, Runtime, reader or SSH substitutes. CPU1/whole768MiB/16 processes/privateTMP/BLAS1; peak247607296 bytes.

Compile ShellUtil.java, ShellResult.java and either tests/regression/ShellTimeoutRegression.java or tests/regression/ShellArrayStderrRegression.java with the real project dependencies and Lombok annotation processor. Run ShellTimeoutRegression <existing-private-work-directory> for the original cases or ShellArrayStderrRegression for the stderr cases. The stderr runner launches child JVMs using the current Java executable/classpath.

Not run: original Lombok1.18.20 configuration, JDK8 runtime, Linux, Maven/full backend or repository tests, live SSH/SCP/deployment, other long-command cleanup or interruption behavior. No observed deployment incident, dependency change or build-configuration change is claimed. The new increment was assisted by Codex0.165.0-alpha.1.2 and carries the contributor sign-off.

Signed-off-by: Hanabi9248 <hanabi210902@gmail.com>
Use real local processes and retain nonzero-exit completion semantics.

Signed-off-by: Hanabi9248 <hanabi210902@gmail.com>
Merge stderr into the existing output reader before waiting for an
array command to exit. A child with enough stderr output otherwise
blocks on its pipe and cannot finish. Preserve argument boundaries
and the real exit code without adding a production timeout.

Add five real-process regressions for bounded stderr output, normal
stdout, nonzero exit status and an argument containing spaces. Each
private emitter has its own watchdog so a failing baseline is bounded.
The existing timeout-start failure correction remains unchanged.

Assisted-by: Codex:0.165.0-alpha.1.2
Signed-off-by: Hanabi <317387557+Hanabi9248@users.noreply.github.com>
@Hanabi9248 Hanabi9248 changed the title fix(common): return false when a shell process cannot start fix(common): preserve shell completion and drain stderr Oct 28, 2026
@Hanabi9248
Hanabi9248 force-pushed the codex/shell-timeout-start-failure branch 2 times, most recently from b0153d6 to 3c4066a Compare October 30, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant