-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only run the openssl_certificate_loader helper once #398
Comments
Coming from /cnb/process/healthcheck triggers start of JVM I have a suspicion that this problem caused me even more trouble: We spent quite some time debugging and troubleshooting it, but we couldn't reproduce it on our local machines (where we run the Java application directly in IntelliJ - without docker)... Since we switched to |
@Dr4K4n Yes, apologies. That sounds plausible. If the truststore is being recreated when you try to read it, you might see a problem like that. |
Same issue here. Our service has healthcheck activated and gets this error few times per day :
|
For folks hitting this due to the health-checker buildpack, we've released health-checker 2.0.0, which no longer provides the option to start the health-check binary through the launcher. Instead, going forward you'll invoke the health check binary directly. The output of the buildpack has changed to provide the location of those binaries, you can invoke the binary directly or the convenience symlink that we create.
Please note that since we're not using the launcher to invoke the health check binary, we cannot set env variables on the image at build time. All environment variables to configure the health check binary must be set when you run the container. The release notes are here: https://github.com/paketo-buildpacks/health-checker/releases/tag/v2.0.0 |
To make the change Before: healthcheck:
test: ['CMD', '/cnb/process/health-check']
interval: 30s
timeout: 10s
retries: 10
start_period: 2m After: healthcheck:
test: ['CMD', '/layers/paketo-buildpacks_health-checker/thc/bin/thc']
interval: 30s
timeout: 10s
retries: 10
start_period: 2m
environment:
THC_PORT: 9093
THC_PATH: /actuator/health `` |
Describe the Enhancement
In most situations, the openssl_certificate_loader helper will run once, just before the application starts. This is the assumed behavior.
The problem is that it can be triggered multiple times and each time it runs it will modify the truststore. For example, if you
docker exec
into the container using thelauncher
then it'll run this again. If you use the Paketo health checker buildpack it'll get triggered every time the health check runs (because presently it's running the health check through the launcher).It's not clear the implications of having this run many times. We have not had reports, but this may cause unforeseen problems.
Possible Solution
Ensure that the process only runs once. I can think of a couple of ways to do this:
java
process running. If so, then exit. If not, then run as normal./tmp
directory the first time this process runs. If that file exists, then exit. If not, then run as normal.You could in theory have a race condition on checking the process list or for the existence of a file, but that should be unlikely. While this exec.d helper can be triggered multiple times, I've not seen any cases where it's triggered simultaneously.
Motivation
The text was updated successfully, but these errors were encountered: