diff --git a/upgrade.sh b/upgrade.sh index ab97bab..aa57657 100644 --- a/upgrade.sh +++ b/upgrade.sh @@ -68,6 +68,28 @@ case "$mode" in ;; esac +# KNOWN GAP (2026-10-01): storeall is not actually guaranteed to see a +# fully quiesced app at the moment it runs. InitServlet.destroy() calls +# HttpController.setRequestsOnHold(true) and waits (up to 2s) for +# HttpController.getRequestCount() to hit zero before calling +# icp.Registry.storeAll() - but that only tracks threads servicing +# incoming HTTP requests through HttpController. Any background thread the +# webapp itself started (e.g. the order schedulers InitServlet.init() spins +# up - see "Starting order schedulers" in InitServlet.java) is invisible to +# that counter and can still be running, and potentially still mutating +# state, while storeall takes its snapshot. storeAll()'s own +# synchronization keeps this from corrupting the DB, but a write from one +# of these threads can still land after storeall's pass and never get +# persisted before shutdown. +# +# Not fixed by anything in this script or by Tomcat's stopwaitsecs (see +# sportrum-ansible's supervisord.conf) - that only protects storeall +# itself from being killed mid-write, it does nothing about threads other +# than the app's own request-handling threads. Properly closing this needs +# a real thread manager in the webapp that can be told to halt (or at +# least pause/join) every thread it started, not just hold new requests, +# called from InitServlet.destroy() before storeAll() runs. Not +# implemented yet - noted here so it isn't forgotten. running=$(./tomcat_ctl.sh status | grep "tomcat8 is stopped") if [ "x$running" == "x" ]; then printf "Call server command storeall.."; sleep 2