[dreamwidth/dreamwidth] 4b5bcf: Add SO_SNDTIMEO middleware to prevent Starman work...
Branch: refs/heads/main Home: https://github.com/dreamwidth/dreamwidth Commit: 4b5bcf8ad5cda83928da05e87508127b1fdd3a46 https://github.com/dreamwidth/dreamwidth/commit/4b5bcf8ad5cda83928da05e87508127b1fdd3a46 Author: Mark Smith mark@dreamwidth.org Date: 2026-03-12 (Thu, 12 Mar 2026)
Changed paths: M app.psgi A cgi-bin/Plack/Middleware/DW/WriteTimeout.pm A t/plack-write-timeout.t
Log Message:
Add SO_SNDTIMEO middleware to prevent Starman workers blocking on dead connections
When the ALB closes a connection before Starman finishes writing a response (e.g. due to idle timeout), the worker's write() blocks for 15-30 minutes waiting for TCP retransmits to exhaust. With 10 workers, this quickly deadlocks the entire server.
The new DW::WriteTimeout middleware sets SO_SNDTIMEO on the client socket via psgix.io so that blocked writes fail in seconds instead of minutes, freeing the worker to handle new requests.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
To unsubscribe from these emails, change your notification settings at https://github.com/dreamwidth/dreamwidth/settings/notifications
