Sixth section of #141, which closes the issue's defect: start no longer waits on Temporal before it serves. Start derives the Stripe key's mode and fingerprint, sets the SDK's key, opens the database, applies the operator overrides and the boot data state, binds the listener, and only then starts the Temporal connector and the identity provider's discovery beside the server. A bind error returns before any dial or discovery request. While Temporal is unreachable the console serves: sign-in, the domain ask, the static files and every page that needs no workflow answer as usual, and the Temporal-backed actions answer as the previous section made them. The connector runs the retry loop. Each attempt dials once (NewClient no longer retries on its own; dialWithRetry and its budget are gone), builds the worker and runs its precondition. A precondition that refuses keeps the client and retries at the cap, so FedWiki's refusal over open runs of a removed workflow type is read again on the same connection; one that cannot read what it checks, a worker that fails to build or start, closes the client and dials again. The attempt ends when the worker starts: "connected to Temporal server" is logged with the attempts and the time it took, then the holder is published and the integrations' Startup hooks and the schedules run as before. "Temporal not ready yet, retrying" is a Warn until temporal-connect-timeout (90 seconds by default), whose help now says so, and an Error from then on, under the loop's decay. A Temporal OAuth configuration that cannot be built still refuses at start. start exits 1 when serving fails, at any point, and returns only after the connector and discovery have returned. A failure before the listener keeps the message it had (the overrides, the boot data state, the integration connections); a serving failure logs "server failed to start". The Stripe webhook activity marks an event processing only from received, processing or failed, so a run of an event already completed, skipped or dead-lettered returns at once and dispatches nothing. The handlers and drains that found no Temporal client logged that it was not configured; with Temporal still connecting that was false, so they log "Temporal is not connected" (the six plan-act goldens carry the new drain line). Copies 13, 15 and 16 also carry the host and namespace. Checked by hand on the test stack: with Temporal stopped, the console served /login and the ask at once; the connector logged Warn, then Error from the first attempt after 90 seconds; when Temporal came back the same process logged "connected to Temporal server" after 14 attempts. With the issuer refusing, /login answered the styled 503 with Retry-After: 5 and the ask answered. Full suite on reset databases: 4513 pass, 15 skip, none failed. go test -race -p 1 over cmd, auth, server, retryloop, workflows and the three integrations after reset-test-db.sh: every package passes, no data race. make lint passes. Breaks, each caught (section 1's UseKey break among them). Two depart from item 6.10's first wording, which the item now carries: the synchronous-fetch break sits between listen and the server's start (before listen the row would fail waiting for the address, not at its one-second assertions), and the "returns without waiting" break is caught by the fourth boot row, whose fake dial holds for 200 ms of wall-clock time past the context's end, the least that makes an early return observable. - serveConsole without UseKey - UseKey after the bound server's Serve - Serve without go Discover - Serve fetches the discovery document before serving - serveConsole waits for connectTemporal before Serve - connectTemporal started before Bind returns - serveConsole returns without waiting for its goroutines - serveConsole returns without waiting for its goroutines (race) - skipSession without the ask's path - connectTemporal publishes after afterConnect - connectTemporal publishes before worker.Start - connectTemporal returns after the escalation time - the open-runs refusal closes the client - ErrCannotCheck treated as a refusal - worker.Start failure leaves the client open - listRunsError without its Is method - worker.Start failure logged from inside the attempt - ProcessWebhookEvent without its status guard - the guard without failed - the guard without processing - NewClient without the deadline - connectTemporal under serveConsole's own context - the attempt runs the hooks before copy 14 - Run logs copy 21 for a step failure - the overrides failure is a plain error - a Temporal authorization that cannot be built is not refused
113 lines
5.0 KiB
JSON
113 lines
5.0 KiB
JSON
{
|
|
"answer": [
|
|
"status 200",
|
|
"Hx-Trigger showSuccessToast: Default change committed for T: 1 migrated, 2 not yet reached.",
|
|
"[id^=\"plan-act-\"]: 2 organizations not yet reached."
|
|
],
|
|
"checked": [],
|
|
"logs": [
|
|
"level=WARN msg=\"Temporal is not connected; the plan act drain was not started\" request_id=<uuid:1> act_id=<act:1>"
|
|
],
|
|
"statements": [
|
|
"begin",
|
|
"SET LOCAL lock_timeout = '5s'",
|
|
"SELECT pg_advisory_xact_lock(hashtextextended($1, 0))",
|
|
"LockOrgType",
|
|
"UpdateOrgTypeDefaultPlanLadder",
|
|
"RecordPlanAct",
|
|
"commit",
|
|
"begin",
|
|
"SET LOCAL lock_timeout = '5s'",
|
|
"SELECT pg_advisory_xact_lock_shared(hashtextextended($1, 0))",
|
|
"WritePlanActObligations",
|
|
"commit",
|
|
"begin",
|
|
"SET LOCAL lock_timeout = '5s'",
|
|
"SELECT pg_advisory_xact_lock_shared(hashtextextended($1, 0))",
|
|
"LockResourcePool",
|
|
"LockPlanActObligation",
|
|
"SELECT core.end_conferral($1, $2, $3, $4, $5, $6, $7, $8)",
|
|
"CreateGrant",
|
|
"SELECT provision_id, outcome FROM core.confer($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)",
|
|
"SELECT core.assert_rendezvous(false)",
|
|
"DeleteContributionsByProvisionID",
|
|
"CreateNumericEntitlementContribution",
|
|
"UpdateNumericEntitlementLimit",
|
|
"SELECT core.assert_rendezvous(false)",
|
|
"DeleteContributionsByProvisionID",
|
|
"CreateNumericEntitlementContribution",
|
|
"UpdateNumericEntitlementLimit",
|
|
"SettlePlanActObligation",
|
|
"commit",
|
|
"begin isolation level repeatable read read only",
|
|
"commit"
|
|
],
|
|
"rows": {
|
|
"tiers": [
|
|
"ladder | rank | product",
|
|
"<ladder:Main> | 0 | <product:Basic>",
|
|
"<ladder:Next> | 0 | <product:Gold>"
|
|
],
|
|
"defaults": [
|
|
"org_type | default_ladder",
|
|
"<orgtype:T> | <ladder:Next>"
|
|
],
|
|
"grants": [
|
|
"grant_id | org | product | grant_reason | granted_by | extends | description | status | act",
|
|
"<uuid:2> | <org:First> | <product:Basic> | default | none | none | | active | none",
|
|
"<uuid:3> | <org:Second> | <product:Basic> | default | none | none | | active | none",
|
|
"<uuid:4> | <org:Third> | <product:Basic> | default | none | none | | active | none",
|
|
"<uuid:5> | <org:First> | <product:Gold> | default | none | none | | active | <act:1>"
|
|
],
|
|
"provisions": [
|
|
"provision | pool | grant_id | status",
|
|
"<uuid:6> | <pool:First> | <uuid:2> | ended",
|
|
"<uuid:7> | <pool:Second> | <uuid:3> | active",
|
|
"<uuid:8> | <pool:Third> | <uuid:4> | active",
|
|
"<uuid:9> | <pool:First> | <uuid:5> | active"
|
|
],
|
|
"positions": [
|
|
"provision | ladder | product | status | ended",
|
|
"<uuid:6> | <ladder:Main> | <product:Basic> | ended | true",
|
|
"<uuid:7> | <ladder:Main> | <product:Basic> | active | false",
|
|
"<uuid:8> | <ladder:Main> | <product:Basic> | active | false",
|
|
"<uuid:9> | <ladder:Next> | <product:Gold> | active | false"
|
|
],
|
|
"transitions": [
|
|
"pool | provision | ladder | from_rank | to_rank | transition_type | actor_type | actor | reason",
|
|
"<pool:First> | <uuid:6> | <ladder:Main> | - | 0 | initiate | system | none | test fixture",
|
|
"<pool:Second> | <uuid:7> | <ladder:Main> | - | 0 | initiate | system | none | test fixture",
|
|
"<pool:Third> | <uuid:8> | <ladder:Main> | - | 0 | initiate | system | none | test fixture",
|
|
"<pool:First> | <uuid:6> | <ladder:Main> | 0 | - | end | operator | <person:Operator> | org-type default change (<orgtype:T>): migrated off the outgoing default",
|
|
"<pool:First> | <uuid:9> | <ladder:Next> | - | 0 | initiate | operator | <person:Operator> | org-type default change (<orgtype:T>)"
|
|
],
|
|
"entitlements": [
|
|
"pool | resource_key | resource_limit",
|
|
"<pool:First> | plan_golden_seats | 5",
|
|
"<pool:Second> | plan_golden_seats | 1",
|
|
"<pool:Third> | plan_golden_seats | 1"
|
|
],
|
|
"acts": [
|
|
"act | cause | actor_type | actor | note | request_id",
|
|
"<act:1> | org_type_default_changed | person | <person:Operator> | none | <uuid:1>"
|
|
],
|
|
"act_details": [
|
|
"act | cause | ladder | ladder_name | product | product_name | previous_product | previous_product_name | org_type | org_type_name | previous_ladder | previous_ladder_name | disposition | retried",
|
|
"<act:1> | org_type_default_changed | <ladder:Next> | Next | <product:Gold> | Gold | none | none | <orgtype:T> | T | <ladder:Main> | Main | migrate | none"
|
|
],
|
|
"reached_org_types": [
|
|
"act | org_type | org_type_name | last_org",
|
|
"<act:1> | <orgtype:T> | T | <org:Third>"
|
|
],
|
|
"orgs_without_pool": [
|
|
"act | org_type | org"
|
|
],
|
|
"obligations": [
|
|
"act | org_type | org | pool | status | outcome | attempts | error_step | superseded_by | requeued_by",
|
|
"<act:1> | <orgtype:T> | <org:First> | <pool:First> | settled | migrated | 0 | none | none | none",
|
|
"<act:1> | <orgtype:T> | <org:Second> | <pool:Second> | pending | none | 0 | none | none | none",
|
|
"<act:1> | <orgtype:T> | <org:Third> | <pool:Third> | pending | none | 0 | none | none | none"
|
|
]
|
|
}
|
|
}
|