Skip to content

fix: race condition causing GZIP corruption on restart#548

Open
yetval wants to merge 1 commit intoQuiteAFancyEmerald:masterfrom
yetval:fix/gzip-race-and-kill-481
Open

fix: race condition causing GZIP corruption on restart#548
yetval wants to merge 1 commit intoQuiteAFancyEmerald:masterfrom
yetval:fix/gzip-race-and-kill-481

Conversation

@yetval
Copy link
Copy Markdown

@yetval yetval commented Apr 13, 2026

Fixes #481

As requested, here's the fix for the restart race condition. Found some more bugs on the way:

  • Build now writes to views/dist-new and atomically renames to views/dist on completion, eliminating the window where the server could serve plain HTML with a gzip Content-Encoding
  • npm run kill now uses npx pm2 kill; pkill -f "node backend.js" || true instead of pkill node, which was killing the pm2 daemon and leaving nginx with stale connections
  • Skip paintSource on vendor scram bundles to fix intermittent esbuild failures on repeated builds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Force restarting creates maximum GZIP gibberish (Nginx)

1 participant