For a long time I've been puzzled as to why occasionally (but not really reproducibly) this app and other Go apps I've written fail to shut down cleanly even with code to capture SIGTERM and friends and distribute the shutdown logic via a context.
My friend Claude helped me see that I had created a possible race condition. Here is how I fixed similar code in a different app.
lmullen/chronam-headliner@c6f30b0