Skip to content

Embedded Q2 no longer System.exits on a startup exception - #766

Merged
ar merged 1 commit into
mainfrom
fix/q2-embedded-no-exit
Sep 4, 2026
Merged

ar merged 1 commit into
mainfrom
fix/q2-embedded-no-exit

Conversation

@ar

@ar ar commented Sep 4, 2026

Copy link
Copy Markdown
Member

Implements #765.

What

Q2.run() catches any Exception escaping the boot sequence, logs it, and called System.exit(1) unconditionally. The clean-shutdown path a few lines above only exits when the exit flag is set, and that flag is set only by Q2.main. The failure path now honours the same flag.

  • Q2 started from the command line: unchanged, exits with status 1 on a startup exception.
  • Embedded Q2 (tests, jPOS-EE, Control Plane): logs the exception and returns from run(); the host JVM survives.

Why

On #764 CI failed with Process 'Gradle Test Executor 4' finished with non-zero exit value 1: a Q2-booting test hit a transient startup exception, the executor JVM died, and Gradle could not report which test tripped. The rerun passed. With this change the same event shows up as a named failing test with the exception in its output.

Tests

No test added; the change is a guard on an existing flag. Full :jpos:test and :jpos:javadoc pass.

Q2.run's catch-all called System.exit(1) unconditionally, so a transient
startup exception in an embedded Q2 (tests, jPOS-EE, the Control Plane)
killed the host JVM. Gate it on the exit flag, which only Q2.main sets,
matching the clean-shutdown path.

Closes #765
@ar
ar merged commit d18d623 into main Sep 4, 2026
1 check passed
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