A request that runs longer than eight seconds loses its answer, though the console lets it run for 32 #290

Closed
opened 2026-10-29 07:34:03 +00:00 by cgalo5758 · 1 comment
Owner

What happens

The server stops writing a response eight seconds after it read the request (WriteTimeout), while the handlers run under a 32-second request timeout (middleware.Timeout). A handler that takes longer than eight seconds still runs to the end, and its writes to the database and to Stripe land, but its answer never reaches the browser: the member sees neither the result nor an error. A plan change makes up to three Stripe calls today, and the switch of a paused plan (#278) up to eight, so a slow Stripe can push one past eight seconds.

What should happen

The time the server allows for writing an answer covers the time a handler may run, so every request the console lets run gets its answer or its timeout page.

Where

internal/server/server.go: the http.Server's WriteTimeout, and middleware.Timeout in the handler chain

Why it matters

A member whose plan changed, or whose card was declined, can be left with no answer at all.

### What happens The server stops writing a response eight seconds after it read the request (`WriteTimeout`), while the handlers run under a 32-second request timeout (`middleware.Timeout`). A handler that takes longer than eight seconds still runs to the end, and its writes to the database and to Stripe land, but its answer never reaches the browser: the member sees neither the result nor an error. A plan change makes up to three Stripe calls today, and the switch of a paused plan (#278) up to eight, so a slow Stripe can push one past eight seconds. ### What should happen The time the server allows for writing an answer covers the time a handler may run, so every request the console lets run gets its answer or its timeout page. ### Where `internal/server/server.go`: the `http.Server`'s `WriteTimeout`, and `middleware.Timeout` in the handler chain ### Why it matters A member whose plan changed, or whose card was declined, can be left with no answer at all.
cgalo5758 added this to the Public launch milestone 2026-10-29 07:34:03 +00:00
cgalo5758 added the
kind
bug
area/billingarea/ops
labels 2026-10-29 07:34:03 +00:00
Author
Owner

A request whose handler took longer than eight seconds lost its answer: the server stopped writing eight seconds after it read the request, while the handler was allowed 32 seconds. A plan change during a slow Stripe call, or a FedWiki request that waited on a site's retention purge, did its work and showed the member nothing. The server now keeps writing for 40 seconds, the 32 a handler may run and 8 more for the answer, so such a request shows its result, and one still running at 32 seconds shows the timeout error, which was lost before as well. The same holds for a request that waits on a Temporal call, such as starting a grant's expiry or signalling a domain claim, each of which can take up to 10 seconds. Neither limit is a setting. A proxy in front of the console needs to wait at least 40 seconds for an answer; the deployment guide says so.

Commit: 1d35f03860

A request whose handler took longer than eight seconds lost its answer: the server stopped writing eight seconds after it read the request, while the handler was allowed 32 seconds. A plan change during a slow Stripe call, or a FedWiki request that waited on a site's retention purge, did its work and showed the member nothing. The server now keeps writing for 40 seconds, the 32 a handler may run and 8 more for the answer, so such a request shows its result, and one still running at 32 seconds shows the timeout error, which was lost before as well. The same holds for a request that waits on a Temporal call, such as starting a grant's expiry or signalling a domain claim, each of which can take up to 10 seconds. Neither limit is a setting. A proxy in front of the console needs to wait at least 40 seconds for an answer; the deployment guide says so. Commit: 1d35f0386006a049d225c0d82d7f2ca23432f274
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wiki-cafe/member-console#290