hashicorp / envconsul

Launch a subprocess with environment variables using data from @HashiCorp Consul and Vault.
https://www.hashicorp.com/
Mozilla Public License 2.0
2.01k stars 190 forks source link

"Kill failed: os: process already finished" error log on normal shutdown #360

Open Victor-N-Suadicani opened 6 months ago

Victor-N-Suadicani commented 6 months ago

Envconsul version

0.13.2

Problem

I saw the following in my application's logs:

2024-03-26T18:36:31.644Z [INFO]  envconsul: (child) receiving signal "interrupt"
2024-03-26T18:36:31.650474Z [INFO] my_app: Received SIGINT. Gracefully shutting down...
2024-03-26T18:36:31.651763Z [INFO] my_app: Gracefully shutdown.
Cleaning up...
2024-03-26T18:36:31.656Z [INFO]  envconsul.runner: stopping
2024-03-26T18:36:31.656Z [INFO]  envconsul: (child) stopping process
2024-03-26T18:36:34.034Z [ERROR] envconsul: (child) Kill failed: os: process already finished

Expected behavior

No error log should've been emitted.

Actual behavior

An error log was emitted, but no actual error occurred. The process shut down as it should. This doesn't happen every time, but sometimes. It seems like the process exited so quickly that envconsul thought something went wrong? But it just exited as it should.