Skip to content

Fix server image signal delivery by exec'ing the JVM#1067

Open
sergio-u-simspace wants to merge 1 commit into
conductor-oss:mainfrom
Simspace:image-supports-graceful-shutdown
Open

Fix server image signal delivery by exec'ing the JVM#1067
sergio-u-simspace wants to merge 1 commit into
conductor-oss:mainfrom
Simspace:image-supports-graceful-shutdown

Conversation

@sergio-u-simspace
Copy link
Copy Markdown
Contributor

Summary

This change updates the server Docker startup path so the JVM becomes the main container process and receives termination signals directly during container shutdown.

Today the image starts the JVM from a shell script and wraps it in a tee pipeline. In that process layout, the shell is the long-lived parent process and the JVM does not receive the container termination signal directly from the normal container stop path.

This change replaces the shell-wrapped JVM startup with exec java ..., so the shell is replaced by the JVM and the JVM becomes PID 1.

Process layout

Example process layout before the change:

PID Process
1 /bin/sh /app/startup.sh
7 nginx: master process
18 java -jar conductor-server.jar
19 tee -a /app/logs/server.log

Example process layout after the change:

PID Process
1 java -jar conductor-server.jar
8 nginx: master process

During normal container termination, the runtime signals PID 1. Before this change that was the shell; after this change it is the JVM.

Why this matters

With this change, JVM shutdown hooks and framework-level graceful shutdown mechanisms can run when the container is terminated.

To use that behavior in a Spring Boot deployment, configure server.shutdown=graceful and a suitable spring.lifecycle.timeout-per-shutdown-phase value.

To test it:

  1. Start the container
  2. Confirm the JVM is the main process
  3. Send SIGTERM or terminate the pod/container
  4. Verify the application logs its graceful shutdown sequence before exit

Additional note

As part of the same change, the startup script no longer wraps the JVM in tee. This keeps the JVM out of a shell pipeline and also avoids unbounded growth of /app/logs/server.log, while preserving container stdout/stderr logging.

@sergio-u-simspace sergio-u-simspace force-pushed the image-supports-graceful-shutdown branch from 0ff274f to cc9a94d Compare May 5, 2026 21:21
@sergio-u-simspace sergio-u-simspace force-pushed the image-supports-graceful-shutdown branch from cc9a94d to 9ced957 Compare May 5, 2026 21:55
@v1r3n v1r3n requested review from bradyyie, c4lm and mp-orkes May 19, 2026 02:54
Copy link
Copy Markdown
Contributor

@c4lm c4lm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure we want to lose that file, I think we need a spring logging config with conductor.server.logfile property (if it's application-level then we don't need that tee anymore)

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.

2 participants