Garage does not handle SIGTERM, only SIGINT #396

Closed
opened 2022-09-27 21:54:04 +00:00 by quentin · 2 comments
Owner

Garage does not get the shutdown signal in Docker, as a consequence, it does not exit cleanly.

Garage does not get the shutdown signal in Docker, as a consequence, it does not exit cleanly.
quentin added the
Bug
label 2022-09-27 21:54:04 +00:00
Contributor

Steps to reproduce:

% cat > garaged.toml <<EOF
metadata_dir = "/var/lib/garage/meta"
data_dir = "/var/lib/garage/data"

replication_mode = "1"

compression_level = 2

rpc_bind_addr = "[::]:3901"
rpc_secret = "f268098fd766283bae1f172c6555fc47d8ce32e9925bd012a4bf311c6973a00a"

[s3_api]
s3_region = "garage"
api_bind_addr = "[::]:3900"
root_domain = ".s3.garage"

[s3_web]
bind_addr = "[::]:3902"
root_domain = ".web.garage"
index = "index.html"
EOF
% mkdir garaged
% docker run \
  --name garaged \
  --rm -e RUST_LOG=garage=trace \
  -v $(pwd)/garaged.toml:/etc/garage.toml \
  -v $(pwd)/garaged/:/var/lib/garage/ \
  dxflrs/garage:v0.8.0-rc1
  
2022-09-27T22:04:29.287099Z  INFO garage_api::generic_server: S3 API server listening on http://[::]:3900    
2022-09-27T22:04:29.287098Z  INFO garage_rpc::system: Doing a bootstrap/discovery step (not_configured: true, no_peers: false, bad_peers: true)
2022-09-27T22:04:29.287101Z  INFO garage_web::web_server: Web server listening on http://[::]:3902

# In another terminal
% time docker stop garaged
garaged

real	0m10,214s
Steps to reproduce: ``` % cat > garaged.toml <<EOF metadata_dir = "/var/lib/garage/meta" data_dir = "/var/lib/garage/data" replication_mode = "1" compression_level = 2 rpc_bind_addr = "[::]:3901" rpc_secret = "f268098fd766283bae1f172c6555fc47d8ce32e9925bd012a4bf311c6973a00a" [s3_api] s3_region = "garage" api_bind_addr = "[::]:3900" root_domain = ".s3.garage" [s3_web] bind_addr = "[::]:3902" root_domain = ".web.garage" index = "index.html" EOF % mkdir garaged % docker run \ --name garaged \ --rm -e RUST_LOG=garage=trace \ -v $(pwd)/garaged.toml:/etc/garage.toml \ -v $(pwd)/garaged/:/var/lib/garage/ \ dxflrs/garage:v0.8.0-rc1 2022-09-27T22:04:29.287099Z INFO garage_api::generic_server: S3 API server listening on http://[::]:3900 2022-09-27T22:04:29.287098Z INFO garage_rpc::system: Doing a bootstrap/discovery step (not_configured: true, no_peers: false, bad_peers: true) 2022-09-27T22:04:29.287101Z INFO garage_web::web_server: Web server listening on http://[::]:3902 # In another terminal % time docker stop garaged garaged real 0m10,214s
lx changed title from Garage does not get the shutdown signal in Docker to Garage does not handle SIGTERM, only SIGINT 2022-09-28 08:19:55 +00:00
Owner

Interesting behavior:

  • when running Garage outside of Docker, sending a SIGTERM terminates Garage immediately without going through the shutdown phase

  • when running Garage inside of Docker, the SIGTERM is simply ignored

SIGINT works both inside and outside of Docker.

Interesting behavior: - when running Garage outside of Docker, sending a SIGTERM terminates Garage immediately without going through the shutdown phase - when running Garage inside of Docker, the SIGTERM is simply ignored SIGINT works both inside and outside of Docker.
lx closed this issue 2022-09-28 10:16:56 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Deuxfleurs/garage#396
No description provided.