diff --git a/komga/CHANGELOG.md b/komga/CHANGELOG.md index 9d205b8cdf..7400ff2645 100644 --- a/komga/CHANGELOG.md +++ b/komga/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.26.1.1 (2026-08-11) + +- Bound the nginx readiness probes (`--connect-timeout` / `--max-time`) so a stalled connection cannot hang the wait, and log a warning when Komga has not answered within 15 minutes + ## 1.26.1 (2026-08-11) - Initial release, based on gotson/komga ([changelog](https://github.com/gotson/komga/releases)) diff --git a/komga/config.yaml b/komga/config.yaml index 4c4bb0a0d2..50b0597082 100644 --- a/komga/config.yaml +++ b/komga/config.yaml @@ -101,4 +101,4 @@ schema: slug: komga udev: true url: https://github.com/alexbelgium/hassio-addons/tree/master/komga -version: "1.26.1" +version: "1.26.1.1" diff --git a/komga/rootfs/etc/services.d/nginx/run b/komga/rootfs/etc/services.d/nginx/run index c7febdae96..adc1f43f5f 100755 --- a/komga/rootfs/etc/services.d/nginx/run +++ b/komga/rootfs/etc/services.d/nginx/run @@ -8,12 +8,27 @@ set -e # bashio::net.wait_for : bashio takes (port host timeout) while the bundled # bashio-standalone.sh takes (host port timeout), and picking the wrong one # would either fail instantly or block for the whole timeout. -for _ in $(seq 1 180); do - if curl -sf -o /dev/null "http://127.0.0.1:25600/komga/"; then +# The per probe timeouts keep the 15 minute ceiling real : without them a +# half open connection would hang a single probe, and the loop, forever. +# A wall clock deadline, not an attempt count : a failed probe costs up to +# max-time on top of the sleep, so counting attempts would stretch the wait to +# roughly twice the advertised ceiling. +komga_ready=false +deadline=$((SECONDS + 900)) +while [ "$SECONDS" -lt "$deadline" ]; do + if curl -sf --connect-timeout 2 --max-time 5 -o /dev/null "http://127.0.0.1:25600/komga/"; then + komga_ready=true break fi sleep 5 done +# Deliberately not fatal : nginx serving a 502 tells the user something is wrong +# and starts working by itself once komga finally answers, while refusing to +# start would take ingress down for good after ha_entrypoint gives up retrying. +if [ "$komga_ready" != true ]; then + bashio::log.warning "Komga did not answer within 15 minutes. Starting NGinx anyway : ingress will return 502 until it does." +fi + bashio::log.info "Starting NGinx..." exec nginx