fix(boot): retry a hung PM2 start so a reboot cannot leave the API down #281

Merged
spark merged 1 commits from task/BIT-32491-boot-pm2-timeout into main 2026-11-19 00:22:41 +00:00
Owner

Summary

  • pm2 startOrReload on pr-api hung after the 2026-11-18 reboot. systemd killed photoreport-boot at 300s and left PM2 empty, so api.next returned 502 and fpa.photoreport.pt returned 500, and the process could not report it.
  • Bound the PM2 call in boot.sh and deploy.sh (kill the daemon and try once). The boot unit retries on failure.

Test plan

  • bash -n on both scripts
  • After merge, the next API deploy's checkout contains pm2_reload / pm2_start
  • https://api.next.photoreport.pt/health stays 200 through the deploy
## Summary - `pm2 startOrReload` on pr-api hung after the 2026-11-18 reboot. systemd killed `photoreport-boot` at 300s and left PM2 empty, so `api.next` returned 502 and `fpa.photoreport.pt` returned 500, and the process could not report it. - Bound the PM2 call in `boot.sh` and `deploy.sh` (kill the daemon and try once). The boot unit retries on failure. ## Test plan - [ ] `bash -n` on both scripts - [ ] After merge, the next API deploy's checkout contains `pm2_reload` / `pm2_start` - [ ] `https://api.next.photoreport.pt/health` stays 200 through the deploy
spark added 1 commit 2026-11-19 00:13:22 +00:00
fix(boot): retry a hung PM2 start so a reboot cannot leave the API down
ci / rust (pull_request) Successful in 5m13s
ci / typescript (pull_request) Successful in 8m55s
c9c994e0a0
pm2 startOrReload hung on pr-api after the 2026-11-18 reboot. systemd killed
photoreport-boot and the process list stayed empty, so nothing could report
the outage. Bound the call, reset the daemon once, and retry the unit.
spark merged commit 53fa7e110c into main 2026-11-19 00:22:41 +00:00
Sign in to join this conversation.