Skip to content

Commit

Permalink
docker: set HEALTHCHECK timeouts to 1s (#3677)
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Cole <adrian@tetrate.io>
  • Loading branch information
codefromthecrypt authored Jan 5, 2024
1 parent 0cdad30 commit 2d738c4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions build-bin/docker/docker-healthcheck
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright 2015-2020 The OpenZipkin Authors
# Copyright 2015-2024 The OpenZipkin Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -45,11 +45,13 @@ case ${kind} in
path=${HEALTHCHECK_PATH:-/health}
endpoint="http://${ip}:${port}${path}"
# Use b3:0 to ensure health checks aren't traced
out=$(wget -qO- "${endpoint}" --header=b3:0 2>&1)
# Use timeout 1s (-T 1) as the health check interval is often 1s
out=$(wget -T 1 -qO- "${endpoint}" --header=b3:0 2>&1)
rc=$?
;;
tcp )
out=$(nc -z ${ip} ${port} 2>&1)
# Use timeout 1s (-w 1) as the health check interval is often 1s
out=$(nc -w 1 -z ${ip} ${port} 2>&1)
rc=$?
;;
* )
Expand Down

0 comments on commit 2d738c4

Please sign in to comment.