member-console start handles no stop signal, so a stop cuts in-flight requests and never stops the Temporal worker
#260
Open
opened 2026-10-24 06:51:53 +00:00 by cgalo5758
·
2 comments
Labels
Clear labels
accessibility
area/billing
area/catalog
area/discourse
area/domains
area/entitlements
area/fedwiki
area/identity
area/integrations
area/licensing
area/member-ui
area/meta
area/operator-ui
area/ops
area/testing
duplicate
good-first-issue
invalid
privacy
security
upstream
wontfix
A barrier for people using assistive technology or a keyboard alone.
The Stripe mirror, checkout, subscriptions, invoices, fulfillment.
Products, prices, plan ladders, purchasability.
The Discourse integration.
The domains registry, claims, placements, the certificate ask.
Entitlement sets, rules, grants, pools, provisioning.
The Federated Wiki integration and farm sync.
Sign-in, sessions, persons, organizations, workspaces, roles.
The provider registry, outbox and webhooks in general.
Licenses, the contributor agreement, SPDX headers.
Member pages.
The repository itself, its contributing guide, CI, the tracker and the workflow.
Operator pages, forms, lists, the design system.
Deployment, configuration, migrations, workflows, instance settings.
The test stack, screens, lint, walkthroughs.
Closed because another issue already covers it.
Small, self-contained, and explained enough to be a first contribution.
Closed because it is not a ticket for this repository.
Touches what a person's data reveals.
Touches authentication, authorization, secrets or data exposure.
Waits on another repository or project before it can move.
Closed because it will not be done, with the reason in the last comment.
kind
bug
The software does something other than what it promises; closed when it again does what it promises.
kind
debt
Code, tests or tooling to clean up with nothing visible changing; closed when they are cleaner.
kind
design
A question to settle before work can be defined; closed when the decision is written down.
kind
docs
Documentation that is wrong or missing; closed when it says the right thing.
kind
enhancement
Something the software does not do yet; closed when it does.
priority
critical
Blocks the active milestone or harms members now.
priority
high
Next in line inside the active milestone.
priority
low
Inside the active milestone, when nothing else is left.
priority
medium
Inside the active milestone, after the high ones.
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: wiki-cafe/member-console#260
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What happens
startinstalls no signal handler: nothing incmd/orinternal/callssignal.Notifyorsignal.NotifyContext. A SIGTERM or SIGINT therefore ends the process at once, by Go's default action. A container stop or a redeploy:The shutdown path exists but nothing reaches it.
server.Bound.Serve(internal/server/server.go) callshttp.Server.Shutdownwith a five-second bound when its context ends, andserveConsole(cmd/start.go) then stops the Temporal connector and callstemporalConnection.stop, which stops the worker and closes the client. ButstartCmd.Runpassescontext.Background(), which never ends. AfterserveConsolereturns,Runalso logs "server failed to start" and callsos.Exit(1)whatever the reason, andos.Exitskips the deferredcloseDB.What should happen
On SIGTERM or SIGINT,
startstops accepting connections, lets in-flight requests finish within a bound, stops the Temporal worker, closes the database and session store pools, and exits with status 0 without logging a start failure. A second signal, or the bound running out, ends the process at once.Where
cmd/start.go(startCmd.Run,serveConsole)Steps
member-console startagainst the test stack.kill -TERM <pid>, ordocker stopfor a container).Why it matters
Every deploy or restart cuts the requests in flight and delays the background work that was running by its activity timeout.
When the stop path waits for requests in flight, the bound decides which of them keep their answer: the console lets a handler run for 32 seconds and keeps writing its answer, or its 503, for 8 more. A bound under 40 seconds cuts some requests the console would otherwise answer. A bound of 40 seconds or more needs the orchestrator's stop grace period set above it; Docker's default is 10 seconds, and the deployment guide doesn't set one.
A member's plan change can keep running after the member's request has been answered: once its first Stripe write is sent, its later Stripe calls and its database writes run to deadlines of their own, up to about 220 seconds in all. The request's timeout handler has already answered at 32 seconds, so a stop path that waits only for the server's tracked requests does not wait for these changes, and closing the database pool then fails the write that records the change, after its write at Stripe. The stop path therefore has to wait for plan changes in flight (for instance a counter that each change holds until its record returns, bounded by about 220 seconds), or the orchestrator's grace period has to cover them; otherwise a stop can cut a change between a Stripe write and the console's record, and each deploy that catches a slow change can leave a change made at Stripe and unrecorded. Running the change's writes as a durable job, which a stop does not cut, was considered and not chosen for #295, because the member's answer needs the charge's outcome at once.