mail_evidence call in flight >90 s makes /healthz time out and the api container is killed #148

Closed
opened 2026-11-02 22:44:03 +00:00 by svc-agent-writer · 5 comments

Summary

On a large mirror, one mail_evidence call can stay in flight for more than 90 seconds. While it does, GET /healthz stops answering within its 1 s probe timeout, and the kubelet kills the api container (exit 137). This has happened twice, both times during a People Mind mail pass (dev/people-mind-mcp#45). The mechanism is not established: the two obvious causes are ruled out below.

Environment

  • Image 0.10.4@sha256:5ab9a2e0…19a4, schema v14, fastmcp 3.4.11, Python 3.12.16.
  • Mirror: about 249,000 messages, 34 mailboxes, database about 2.7 GB.
  • Liveness probe: GET /healthz, timeout 1 s, period 30 s, failure threshold 3.
  • The same mirror on 0.10.3 had the same kill once, also during a People Mind pass.

Evidence

Counts and timings from the api log (Processing request of type CallToolRequest lines) and pod events. The only client in the window was People Mind, which calls mail_changes (paging) and then mail_evidence(address=…) once per address, in sorted address order, one call at a time, at most 4 per second.

Window (UTC) Calls per minute Phase
21:59–22:12 88–203 mail_changes paging
22:13–22:30 240 (pacer limit) mail_evidence
22:31:08 one call took 12 s mail_evidence
22:31:20–22:31:21 three calls, about 0.8 s each mail_evidence
22:31:21 call started, never logged a reply mail_evidence
22:33:05 liveness kill, exit 137 —

Pod events: Liveness probe failed: … context deadline exceeded (Client.Timeout exceeded while awaiting headers), then a readiness failure, then Container api failed liveness probe, will be restarted.

The sync container in the same pod completed passes at 22:31:37 and 22:31:58, so the database was writable and not locked during the stall.

The log does not record the tool arguments or the call duration, so the address that caused the stall is not known. Because People Mind sorts the addresses, a rerun of its pass is expected to reach the same address.

Ruled out

  • Store lock. Store.evidence holds self._lock for its three queries, but /healthz calls last_ok_sync, which opens its own read-only connection. A slow evidence query cannot make /healthz wait on the lock.
  • GIL held by the signature regex. evidence._ADDRESS is quadratic on a long line without whitespace or @ (synthetic line: 20,000 chars 1.6 s, 40,000 chars 6.2 s). But run through asyncio.to_thread on Python 3.12, it did not stall an asyncio ticker (longest stall 0.01 s), so it cannot by itself block /healthz. It is still a cost worth bounding: sign_off runs it on every line of the body before it selects the last paragraph.
  • Slow tools in general. On the same mirror, mail_search taking 11–12 s and mail_count taking about 60 s left /healthz answering in under 0.01 s.

Open questions

  1. What does /healthz wait on during the stall? Candidates, unconfirmed: the anyio worker-thread limiter (40 tokens) if threads pile up, or contention in the HTTP or auth path.
  2. Which mail_evidence arguments take more than 90 s, and why: the correlated NOT EXISTS copy check for a high-volume sender, the regex on a large body, or something else.

Proposed next steps

  1. Log each tool call's name and duration at completion. Log arguments only as a length or a hash, never the address.
  2. Make a stall diagnosable: for example, faulthandler.dump_traceback_later armed per tool call, or a signal handler that dumps every thread's stack, so the next stall shows where each thread is.
  3. Bound the cost of mail_evidence: cap the body length passed to evidence.signatures, or run the address redaction only on the paragraphs sign_off inspects.
  4. Add a regression test: a mail_evidence call on a sender with a pathological body keeps /healthz answering within 1 s.
## Summary On a large mirror, one `mail_evidence` call can stay in flight for more than 90 seconds. While it does, `GET /healthz` stops answering within its 1 s probe timeout, and the kubelet kills the `api` container (exit 137). This has happened twice, both times during a People Mind mail pass ([dev/people-mind-mcp#45](https://git.groupthink.asia/dev/people-mind-mcp/issues/45)). The mechanism is not established: the two obvious causes are ruled out below. ## Environment - Image `0.10.4@sha256:5ab9a2e0…19a4`, schema v14, fastmcp 3.4.11, Python 3.12.16. - Mirror: about 249,000 messages, 34 mailboxes, database about 2.7 GB. - Liveness probe: `GET /healthz`, timeout 1 s, period 30 s, failure threshold 3. - The same mirror on 0.10.3 had the same kill once, also during a People Mind pass. ## Evidence Counts and timings from the `api` log (`Processing request of type CallToolRequest` lines) and pod events. The only client in the window was People Mind, which calls `mail_changes` (paging) and then `mail_evidence(address=…)` once per address, in sorted address order, one call at a time, at most 4 per second. | Window (UTC) | Calls per minute | Phase | | --- | --- | --- | | 21:59–22:12 | 88–203 | `mail_changes` paging | | 22:13–22:30 | 240 (pacer limit) | `mail_evidence` | | 22:31:08 | one call took 12 s | `mail_evidence` | | 22:31:20–22:31:21 | three calls, about 0.8 s each | `mail_evidence` | | 22:31:21 | call started, never logged a reply | `mail_evidence` | | 22:33:05 | liveness kill, exit 137 | — | Pod events: `Liveness probe failed: … context deadline exceeded (Client.Timeout exceeded while awaiting headers)`, then a readiness failure, then `Container api failed liveness probe, will be restarted`. The `sync` container in the same pod completed passes at 22:31:37 and 22:31:58, so the database was writable and not locked during the stall. The log does not record the tool arguments or the call duration, so the address that caused the stall is not known. Because People Mind sorts the addresses, a rerun of its pass is expected to reach the same address. ## Ruled out - **Store lock.** `Store.evidence` holds `self._lock` for its three queries, but `/healthz` calls `last_ok_sync`, which opens its own read-only connection. A slow evidence query cannot make `/healthz` wait on the lock. - **GIL held by the signature regex.** `evidence._ADDRESS` is quadratic on a long line without whitespace or `@` (synthetic line: 20,000 chars 1.6 s, 40,000 chars 6.2 s). But run through `asyncio.to_thread` on Python 3.12, it did not stall an asyncio ticker (longest stall 0.01 s), so it cannot by itself block `/healthz`. It is still a cost worth bounding: `sign_off` runs it on every line of the body before it selects the last paragraph. - **Slow tools in general.** On the same mirror, `mail_search` taking 11–12 s and `mail_count` taking about 60 s left `/healthz` answering in under 0.01 s. ## Open questions 1. What does `/healthz` wait on during the stall? Candidates, unconfirmed: the anyio worker-thread limiter (40 tokens) if threads pile up, or contention in the HTTP or auth path. 2. Which `mail_evidence` arguments take more than 90 s, and why: the correlated `NOT EXISTS` copy check for a high-volume sender, the regex on a large body, or something else. ## Proposed next steps 1. Log each tool call's name and duration at completion. Log arguments only as a length or a hash, never the address. 2. Make a stall diagnosable: for example, `faulthandler.dump_traceback_later` armed per tool call, or a signal handler that dumps every thread's stack, so the next stall shows where each thread is. 3. Bound the cost of `mail_evidence`: cap the body length passed to `evidence.signatures`, or run the address redaction only on the paragraphs `sign_off` inspects. 4. Add a regression test: a `mail_evidence` call on a sender with a pathological body keeps `/healthz` answering within 1 s.
Author
Member

This was generated by AI during triage.

Agent Brief

Category: bug
Summary: Make the next /healthz stall diagnosable, and bound the cost of mail_evidence address redaction. This brief does not fix the root cause, because the mechanism is not known yet.

Current behavior:

  • The api process logs no tool name and no duration for a tool call, so a stalled call cannot be identified.
  • Nothing dumps thread stacks when the event loop or a tool call stalls. A liveness kill (exit 137) leaves no trace of where each thread was.
  • sign_off in the evidence module runs the _ADDRESS redaction regex on every line of the trimmed body. The regex is quadratic on a long line without whitespace: 20,000 characters take about 1 s.

Triage checked these premises in the code:

  • /healthz does not wait on the Store lock. Store.last_ok_sync opens its own read-only connection, and the route runs it through Starlette's run_in_threadpool.
  • FastMCP 3.4.11 runs sync tools through anyio.to_thread.run_sync. That is the same default anyio limiter (40 threads) that /healthz uses. Exhaustion of this limiter is a candidate cause, not a confirmed one.
  • On Python 3.14, the regex in a worker thread did not stall an asyncio ticker (longest gap 0.006 s). Production runs 3.12.16, which triage did not test.

Desired behavior:

  1. Per-call log. When each tool call completes, the api process logs one line with the tool name, the duration in milliseconds and the outcome: ok or the error code. It logs no argument in any form: no value, no hash, no length of an address. ADR 0008 §6 says "The address in a call is never logged." The issue proposed a hash of the address. A hash still links calls to one sender, so do not log it.

  2. Event-loop stall dump. The api process arms faulthandler.dump_traceback_later(timeout, repeat=True) and re-arms it from an asyncio heartbeat task. If the event loop stops for longer than the timeout, the faulthandler C thread dumps the stack of every thread to stderr. That thread does not need the GIL.

  3. Slow-call dump. When one tool call runs longer than a threshold, the api process dumps the stack of every thread once for that call. Note that dump_traceback_later has one timer per process, so it cannot also be armed per call. Use a separate mechanism, for example a Python watchdog thread.

  4. Configuration. Both thresholds are config fields with defaults, for example 20 s for the event loop and 60 s for a slow call. A value of 0 turns that dump off. Choose the default event-loop threshold so the dump fires before a liveness kill at the current probe settings (period 30 s, failure threshold 3).

  5. Linear-time redaction. For every input, sign_off returns exactly the output it returns today. Its run time is linear in the body length, also on a long line without whitespace, with or without an @. Two traps:

    • Redacting only the last paragraphs is not equivalent. _BOILERPLATE matches unsubscribe inside an unredacted address such as unsubscribe@list.example, so redaction must run before the boilerplate check on every paragraph that the check reads.
    • Line-length checks (MAX_SIGN_OFF_LINE_CHARS) are measured after redaction. A line that redaction makes shorter can still anchor or join a block.

    Acceptable approaches include a regex rewrite that keeps the same matches, or a cheap guard before the regex runs. The equivalence must hold either way.

Key interfaces:

  • The tool registration or the _render wrapper in the server module: the place where one tool call starts and ends.
  • build_app() or the api lifespan: where the heartbeat task starts and stops.
  • The server section of MailmindConfig: the two new threshold fields.
  • evidence._ADDRESS, evidence.sign_off and evidence.REDACTED: the redaction contract that must not change.

Acceptance criteria:

  • A unit test calls a tool and asserts that one log record holds the tool name, a duration and the outcome.
  • A unit test calls mail_evidence with a known address and asserts that the address does not appear in any log record, and that no hash or length of it appears.
  • A unit test blocks the event loop past a short threshold and asserts that a stack dump is written. Use a file or a pipe, not the real stderr.
  • A unit test runs a tool call past a short slow-call threshold and asserts that one stack dump is written.
  • A threshold of 0 turns off its dump, and a test covers this.
  • Every existing evidence test passes without change.
  • A new test compares the new sign_off with the old redaction on a corpus of crafted lines and asserts equal output. Include unsubscribe@…, a line that redaction shortens below 72 characters, a line that is only an address, and several @ in one token.
  • A test runs sign_off on a 40,000-character line without whitespace, once with an @ and once without. Each run finishes in under 0.2 s.
  • make check passes.

Out of scope:

  • The liveness or readiness probe settings in deploy/k8s, and any split of liveness from /healthz. The maintainer rules on this after a stack dump shows the cause.
  • The SQL of Store.evidence, including the correlated NOT EXISTS copy check. Change it only if a captured dump implicates it, and do that in a separate issue.
  • The anyio thread limiter size.
  • Any new field in the mail_evidence output (ADR 0008 §2).
  • Closing #148. The issue stays open for the root cause. After release, a human reruns the People Mind pass on the live mirror and reads the dump.
> *This was generated by AI during triage.* ## Agent Brief **Category:** bug **Summary:** Make the next `/healthz` stall diagnosable, and bound the cost of `mail_evidence` address redaction. This brief does not fix the root cause, because the mechanism is not known yet. **Current behavior:** - The api process logs no tool name and no duration for a tool call, so a stalled call cannot be identified. - Nothing dumps thread stacks when the event loop or a tool call stalls. A liveness kill (exit 137) leaves no trace of where each thread was. - `sign_off` in the evidence module runs the `_ADDRESS` redaction regex on every line of the trimmed body. The regex is quadratic on a long line without whitespace: 20,000 characters take about 1 s. Triage checked these premises in the code: - `/healthz` does not wait on the `Store` lock. `Store.last_ok_sync` opens its own read-only connection, and the route runs it through Starlette's `run_in_threadpool`. - FastMCP 3.4.11 runs sync tools through `anyio.to_thread.run_sync`. That is the same default anyio limiter (40 threads) that `/healthz` uses. Exhaustion of this limiter is a candidate cause, not a confirmed one. - On Python 3.14, the regex in a worker thread did not stall an asyncio ticker (longest gap 0.006 s). Production runs 3.12.16, which triage did not test. **Desired behavior:** 1. **Per-call log.** When each tool call completes, the api process logs one line with the tool name, the duration in milliseconds and the outcome: `ok` or the error code. It logs no argument in any form: no value, no hash, no length of an address. ADR 0008 §6 says "The address in a call is never logged." The issue proposed a hash of the address. A hash still links calls to one sender, so do not log it. 2. **Event-loop stall dump.** The api process arms `faulthandler.dump_traceback_later(timeout, repeat=True)` and re-arms it from an asyncio heartbeat task. If the event loop stops for longer than the timeout, the faulthandler C thread dumps the stack of every thread to stderr. That thread does not need the GIL. 3. **Slow-call dump.** When one tool call runs longer than a threshold, the api process dumps the stack of every thread once for that call. Note that `dump_traceback_later` has one timer per process, so it cannot also be armed per call. Use a separate mechanism, for example a Python watchdog thread. 4. **Configuration.** Both thresholds are config fields with defaults, for example 20 s for the event loop and 60 s for a slow call. A value of 0 turns that dump off. Choose the default event-loop threshold so the dump fires before a liveness kill at the current probe settings (period 30 s, failure threshold 3). 5. **Linear-time redaction.** For every input, `sign_off` returns exactly the output it returns today. Its run time is linear in the body length, also on a long line without whitespace, with or without an `@`. Two traps: - Redacting only the last paragraphs is **not** equivalent. `_BOILERPLATE` matches `unsubscribe` inside an unredacted address such as `unsubscribe@list.example`, so redaction must run before the boilerplate check on every paragraph that the check reads. - Line-length checks (`MAX_SIGN_OFF_LINE_CHARS`) are measured after redaction. A line that redaction makes shorter can still anchor or join a block. Acceptable approaches include a regex rewrite that keeps the same matches, or a cheap guard before the regex runs. The equivalence must hold either way. **Key interfaces:** - The tool registration or the `_render` wrapper in the server module: the place where one tool call starts and ends. - `build_app()` or the api lifespan: where the heartbeat task starts and stops. - The server section of `MailmindConfig`: the two new threshold fields. - `evidence._ADDRESS`, `evidence.sign_off` and `evidence.REDACTED`: the redaction contract that must not change. **Acceptance criteria:** - [ ] A unit test calls a tool and asserts that one log record holds the tool name, a duration and the outcome. - [ ] A unit test calls `mail_evidence` with a known address and asserts that the address does not appear in any log record, and that no hash or length of it appears. - [ ] A unit test blocks the event loop past a short threshold and asserts that a stack dump is written. Use a file or a pipe, not the real stderr. - [ ] A unit test runs a tool call past a short slow-call threshold and asserts that one stack dump is written. - [ ] A threshold of 0 turns off its dump, and a test covers this. - [ ] Every existing evidence test passes without change. - [ ] A new test compares the new `sign_off` with the old redaction on a corpus of crafted lines and asserts equal output. Include `unsubscribe@…`, a line that redaction shortens below 72 characters, a line that is only an address, and several `@` in one token. - [ ] A test runs `sign_off` on a 40,000-character line without whitespace, once with an `@` and once without. Each run finishes in under 0.2 s. - [ ] `make check` passes. **Out of scope:** - The liveness or readiness probe settings in `deploy/k8s`, and any split of liveness from `/healthz`. The maintainer rules on this after a stack dump shows the cause. - The SQL of `Store.evidence`, including the correlated `NOT EXISTS` copy check. Change it only if a captured dump implicates it, and do that in a separate issue. - The anyio thread limiter size. - Any new field in the `mail_evidence` output (ADR 0008 §2). - Closing #148. The issue stays open for the root cause. After release, a human reruns the People Mind pass on the live mirror and reads the dump.
Collaborator

⏸ SVD architect gate: dev/mail-mind-mcp#148 mail-evidence-call-in-flight-90-s-makes-healthz-time-out-and

Status: CLEAN after 0 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity standard · dispatch effort medium

Run: 20261102T231527Z-80641e7c

Held because: CLEAN but 3 open risk(s) (2 verification · 1 decision) — HOLD-ALL parks everything. The risks, verbatim:

Open risks:

  1. Root cause stays unknown by design; #148 stays open. After release a human reruns the People Mind pass on the live mirror. Check: kubectl logs <api-pod> -c api --previous (or the current container) shows a faulthandler 'Timeout (0:00:20)!' block or a 'slow tool call tool=mail_evidence seconds=…' header with all thread stacks, and the 'tool call' lines name the last call that completed before the stall. [verification]
  2. First-emitter proof in the live datasource. Check: after deploy, kubectl logs <api-pod> -c api | grep '"msg": "tool call"' returns lines with tool, duration_ms and outcome, and no line contains an '@'. [verification]
  3. ADR 0008 §6 says 'Logs carry counts and error codes only', and CLAUDE.md says 'counts, roles and error codes only'. A tool name and a duration are neither. The triage brief explicitly asks for them. Question: is the CLAUDE.md Logs-rule extension in this spec enough, or does ADR 0008 §6 need an amendment line naming the per-call tool, duration and outcome? Lean: no ADR amendment, because the tool name is a server constant and the duration is a measurement, not mail data. [decision]

Change: (1) evidence.py:20,67 — replace the quadratic _ADDRESS.sub with a single-pass _redact: _TOKEN=[^\s<>()[],;:"'|]+ sub'd to REDACTED iff '@' in run[1:-1]. This was proven identical at spec time on 300k random strings plus the crafted lines. Order is unchanged, so redaction still runs before the _BOILERPLATE and 72-char checks. A 40k line takes 0.0008 s, against 1.57 s at 20k today. (2) server.py:277-290 _render, plus mail_triage_rows at 1083-1108: wrap each call in a _tool_call(tool) context manager. It registers the call in a module-level stall.SlowCalls and logs one 'tool call' record with exactly the extras tool, duration_ms and outcome (ok, a BladeError.code, or internal). It logs no argument. (3) server.py:1433-1445 build_app: wrap app.router.lifespan_context so that FastMCP's inner lifespan is entered first, then stall.loop_watch(loop_stall_dump_seconds), which re-arms faulthandler.dump_traceback_later(repeat=True) from an asyncio heartbeat. _slow_calls.start(slow_call_dump_seconds) and stop() run inside it. (4) New stall.py, stdlib only: loop_watch plus a SlowCalls watchdog thread modelled on jmap.py:340-356. It dumps all thread stacks once per call past the threshold, with faulthandler.dump_traceback(all_threads=True) and a header that names only the tool. (5) config.py ServerConfig: two fields, loop_stall_dump_seconds=20.0 and slow_call_dump_seconds=60.0. Each accepts 0 (off) or at least 1, with a validator mirroring config.py:141-146. (6) cli.py:41-62 _JsonFormatter: add 'tool' and 'outcome' to the allowlist. (7) Docs: README [server] row and Health section, config.example.toml [server], CLAUDE.md structure line and Logs rule.

Files: src/mail_mind_mcp/evidence.py · src/mail_mind_mcp/stall.py · src/mail_mind_mcp/server.py · src/mail_mind_mcp/config.py · src/mail_mind_mcp/cli.py · tests/test_stall.py · tests/test_evidence.py · tests/test_config.py · README.md · config.example.toml · CLAUDE.md

Decision: accept the 3 open risk(s) above and dispatch this spec (svd:go), or park (svd:skip) / re-spec (svd:respec)?

Your call (when this issue is held at the gate via svd:hold):

  • add label svd:go — approve; Half-B dispatch accepts exactly this spec (open risks accepted)
  • add label svd:fire beside svd:go — approve AND authorise the Half-B fire from the phone; never on its own
  • add label svd:skip — park it; dispatch refuses it and the issue stays for a human
  • add label svd:respec — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context

Spec: /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-02-mail-evidence-call-in-flight-90-s-makes-healthz-time-out-and.md — next: codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-02-mail-evidence-call-in-flight-90-s-makes-healthz-time-out-and.md

### ⏸ SVD architect gate: dev/mail-mind-mcp#148 mail-evidence-call-in-flight-90-s-makes-healthz-time-out-and **Status:** CLEAN after 0 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity `standard` · dispatch effort `medium` **Run:** `20261102T231527Z-80641e7c` **Held because:** CLEAN but 3 open risk(s) (2 verification · 1 decision) — HOLD-ALL parks everything. The risks, verbatim: **Open risks:** 1. Root cause stays unknown by design; #148 stays open. After release a human reruns the People Mind pass on the live mirror. Check: `kubectl logs <api-pod> -c api --previous` (or the current container) shows a faulthandler 'Timeout (0:00:20)!' block or a 'slow tool call tool=mail_evidence seconds=…' header with all thread stacks, and the 'tool call' lines name the last call that completed before the stall. [verification] 2. First-emitter proof in the live datasource. Check: after deploy, `kubectl logs <api-pod> -c api | grep '"msg": "tool call"'` returns lines with tool, duration_ms and outcome, and no line contains an '@'. [verification] 3. ADR 0008 §6 says 'Logs carry counts and error codes only', and CLAUDE.md says 'counts, roles and error codes only'. A tool name and a duration are neither. The triage brief explicitly asks for them. Question: is the CLAUDE.md Logs-rule extension in this spec enough, or does ADR 0008 §6 need an amendment line naming the per-call tool, duration and outcome? Lean: no ADR amendment, because the tool name is a server constant and the duration is a measurement, not mail data. [decision] **Change:** (1) evidence.py:20,67 — replace the quadratic _ADDRESS.sub with a single-pass _redact: _TOKEN=[^\s<>()\[\],;:"'|]+ sub'd to REDACTED iff '@' in run[1:-1]. This was proven identical at spec time on 300k random strings plus the crafted lines. Order is unchanged, so redaction still runs before the _BOILERPLATE and 72-char checks. A 40k line takes 0.0008 s, against 1.57 s at 20k today. (2) server.py:277-290 _render, plus mail_triage_rows at 1083-1108: wrap each call in a _tool_call(tool) context manager. It registers the call in a module-level stall.SlowCalls and logs one 'tool call' record with exactly the extras tool, duration_ms and outcome (ok, a BladeError.code, or internal). It logs no argument. (3) server.py:1433-1445 build_app: wrap app.router.lifespan_context so that FastMCP's inner lifespan is entered first, then stall.loop_watch(loop_stall_dump_seconds), which re-arms faulthandler.dump_traceback_later(repeat=True) from an asyncio heartbeat. _slow_calls.start(slow_call_dump_seconds) and stop() run inside it. (4) New stall.py, stdlib only: loop_watch plus a SlowCalls watchdog thread modelled on jmap.py:340-356. It dumps all thread stacks once per call past the threshold, with faulthandler.dump_traceback(all_threads=True) and a header that names only the tool. (5) config.py ServerConfig: two fields, loop_stall_dump_seconds=20.0 and slow_call_dump_seconds=60.0. Each accepts 0 (off) or at least 1, with a validator mirroring config.py:141-146. (6) cli.py:41-62 _JsonFormatter: add 'tool' and 'outcome' to the allowlist. (7) Docs: README [server] row and Health section, config.example.toml [server], CLAUDE.md structure line and Logs rule. **Files:** `src/mail_mind_mcp/evidence.py` · `src/mail_mind_mcp/stall.py` · `src/mail_mind_mcp/server.py` · `src/mail_mind_mcp/config.py` · `src/mail_mind_mcp/cli.py` · `tests/test_stall.py` · `tests/test_evidence.py` · `tests/test_config.py` · `README.md` · `config.example.toml` · `CLAUDE.md` **Decision:** accept the 3 open risk(s) above and dispatch this spec (`svd:go`), or park (`svd:skip`) / re-spec (`svd:respec`)? **Your call** (when this issue is held at the gate via `svd:hold`): - add label `svd:go` — approve; Half-B dispatch accepts exactly this spec (open risks accepted) - add label `svd:fire` **beside** `svd:go` — approve AND authorise the Half-B fire from the phone; never on its own - add label `svd:skip` — park it; dispatch refuses it and the issue stays for a human - add label `svd:respec` — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context <sub>Spec: `/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-02-mail-evidence-call-in-flight-90-s-makes-healthz-time-out-and.md` — next: `codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-02-mail-evidence-call-in-flight-90-s-makes-healthz-time-out-and.md`</sub>
Collaborator

spec-verify-dispatch Half B for dev/mail-mind-mcp#148 mail-evidence-call-in-flight-90-s-makes-healthz-time-out-and completed integration verify.

  • PR: #149
  • Branch: feat/svd-dev-mail-mind-mcp-148-mail-evidence-call-in-flight-9-7aa0e4ad
  • Commit: 4485fd6d33
  • Build: none
  • Test: green
  • Reader audit clean: True
  • Spec fidelity: True
  • Ready for merge: False
  • Check forgejo commit statuses: absent
  • Checks: Local: make check green at 4485fd6 (987 passed, 8 skipped, audit clean). All spec-mapped tests collect. Remote: no Forgejo commit statuses (absent). One blocker: the PR body has Closes #148 and the spec requires Refs only.
  • Blocker: PR metadata: remove the line Closes #148 from the PR body; the spec requires Refs #148 only, and the body currently has both.
  • Blocker cause: work for PR metadata: remove the line Closes #148 from the PR body; the spec requires Refs #148 only, and the body currently has both.; no denial signature; evidence: PR #149 body line 14 Refs #148, line 16 Closes #148; spec: 'The PR body says Refs #148, not Closes.'
  • Warning: self-review: the existing mailbox-search test's logging assertion is stale -> not fixed. It is now resolved: the branch's second commit 4485fd6 updates tests/test_mailbox_search.py per spec Adjustment A1, and the test passes.
  • Warning: The PR body trailer reads Co-Authored-By: gpt-6.1-sol. Check that it matches the repo's attribution convention.
  • Warning: No remote CI statuses exist on the PR head, so local make check is the only integration evidence.
  • Warning: Open risk 3 (decision): ADR 0008 §6 may need an amendment line for the per-call log. The spec leans no amendment.
  • Warning: no CI for forgejo commit statuses: The PR head 4485fd6 has no commit statuses on Forgejo (empty list). No CI run exists to track. — reported as absent, not blocking (gh#633)
  • Rework: 1 round(s), outcome metadata-hold
  • Escalation: PR metadata blocker(s) hold the run without code rework: PR metadata: remove the line Closes #148 from the PR body; the spec requires Refs #148 only, and the body currently has both.; edit the PR title or body by hand, then re-run integrate or run the own-execution gate.
  • Decision: resolve the blockers above and rerun integrate, or park this PR for a human?
spec-verify-dispatch Half B for dev/mail-mind-mcp#148 mail-evidence-call-in-flight-90-s-makes-healthz-time-out-and completed integration verify. - PR: https://git.groupthink.asia/dev/mail-mind-mcp/pulls/149 - Branch: feat/svd-dev-mail-mind-mcp-148-mail-evidence-call-in-flight-9-7aa0e4ad - Commit: 4485fd6d337f1bbdc3c042649b60c87380c32bf9 - Build: none - Test: green - Reader audit clean: True - Spec fidelity: True - Ready for merge: False - Check forgejo commit statuses: absent - Checks: Local: make check green at 4485fd6 (987 passed, 8 skipped, audit clean). All spec-mapped tests collect. Remote: no Forgejo commit statuses (absent). One blocker: the PR body has `Closes #148` and the spec requires `Refs` only. - Blocker: PR metadata: remove the line `Closes #148` from the PR body; the spec requires `Refs #148` only, and the body currently has both. - Blocker cause: work for PR metadata: remove the line `Closes #148` from the PR body; the spec requires `Refs #148` only, and the body currently has both.; no denial signature; evidence: PR #149 body line 14 `Refs #148`, line 16 `Closes #148`; spec: 'The PR body says `Refs #148`, not `Closes`.' - Warning: self-review: the existing mailbox-search test's logging assertion is stale -> not fixed. It is now resolved: the branch's second commit 4485fd6 updates tests/test_mailbox_search.py per spec Adjustment A1, and the test passes. - Warning: The PR body trailer reads `Co-Authored-By: gpt-6.1-sol`. Check that it matches the repo's attribution convention. - Warning: No remote CI statuses exist on the PR head, so local `make check` is the only integration evidence. - Warning: Open risk 3 (decision): ADR 0008 §6 may need an amendment line for the per-call log. The spec leans no amendment. - Warning: no CI for forgejo commit statuses: The PR head 4485fd6 has no commit statuses on Forgejo (empty list). No CI run exists to track. — reported as absent, not blocking (gh#633) - Rework: 1 round(s), outcome metadata-hold - Escalation: PR metadata blocker(s) hold the run without code rework: PR metadata: remove the line `Closes #148` from the PR body; the spec requires `Refs #148` only, and the body currently has both.; edit the PR title or body by hand, then re-run integrate or run the own-execution gate. - Decision: resolve the blockers above and rerun integrate, or park this PR for a human?
Collaborator

spec-verify-dispatch Half B for dev/mail-mind-mcp#148 mail-evidence-call-in-flight-90-s-makes-healthz-time-out-and completed integration verify.

  • PR: #149
  • Branch: feat/svd-dev-mail-mind-mcp-148-mail-evidence-call-in-flight-9-7aa0e4ad
  • Commit: 4485fd6d33
  • Build: none
  • Test: green
  • Reader audit clean: True
  • Spec fidelity: True
  • Ready for merge: True
  • Check forgejo commit statuses on PR head: absent
  • Checks: PR #149 at 4485fd6: local make check is green with 987 passed and 8 skipped. The repo has no remote CI statuses, so that check is absent. No blockers.
  • Warning: The PR body is stale. It says the full suite had 1 failure and that make check stopped before audit. The last commit 4485fd6 fixed tests/test_mailbox_search.py::test_unknown_mailbox_warns, which the spec names as Agent Adjustment A1. At 4485fd6, make check passes: ruff, format, mypy strict, 987 passed, 8 skipped, and pip-audit clean. Update the PR body.
  • Warning: self-review: the mailbox-search test's logging assertion was stale -> not fixed: the test lies outside the spec's Primary Files. The spec Test Strategy row A1 covers it, and a later commit modified it. No action remains.
  • Warning: No remote CI exists for this repo. The PR head has no commit statuses.
  • Warning: Open spec risk 3 (decision): the spec leaves open whether ADR 0008 §6 needs an amendment for per-call logging. Open spec risks 1 and 2 are post-release live checks. Issue #148 stays open by design: the PR says Refs #148.
  • Warning: no CI for forgejo commit statuses on PR head: The PR head 4485fd6 has no commit statuses on git.groupthink.asia. CLAUDE.md says the architect adds CI files (.woodpecker/*), so the repo reports no CI. — reported as absent, not blocking (gh#633)
  • Decision: review the PR and merge? (codex-svd ship --run-id 20261102T233859Z-7aa0e4ad --confirm-merge)
spec-verify-dispatch Half B for dev/mail-mind-mcp#148 mail-evidence-call-in-flight-90-s-makes-healthz-time-out-and completed integration verify. - PR: https://git.groupthink.asia/dev/mail-mind-mcp/pulls/149 - Branch: feat/svd-dev-mail-mind-mcp-148-mail-evidence-call-in-flight-9-7aa0e4ad - Commit: 4485fd6d337f1bbdc3c042649b60c87380c32bf9 - Build: none - Test: green - Reader audit clean: True - Spec fidelity: True - Ready for merge: True - Check forgejo commit statuses on PR head: absent - Checks: PR #149 at 4485fd6: local make check is green with 987 passed and 8 skipped. The repo has no remote CI statuses, so that check is absent. No blockers. - Warning: The PR body is stale. It says the full suite had 1 failure and that make check stopped before audit. The last commit 4485fd6 fixed tests/test_mailbox_search.py::test_unknown_mailbox_warns, which the spec names as Agent Adjustment A1. At 4485fd6, make check passes: ruff, format, mypy strict, 987 passed, 8 skipped, and pip-audit clean. Update the PR body. - Warning: self-review: the mailbox-search test's logging assertion was stale -> not fixed: the test lies outside the spec's Primary Files. The spec Test Strategy row A1 covers it, and a later commit modified it. No action remains. - Warning: No remote CI exists for this repo. The PR head has no commit statuses. - Warning: Open spec risk 3 (decision): the spec leaves open whether ADR 0008 §6 needs an amendment for per-call logging. Open spec risks 1 and 2 are post-release live checks. Issue #148 stays open by design: the PR says Refs #148. - Warning: no CI for forgejo commit statuses on PR head: The PR head 4485fd6 has no commit statuses on git.groupthink.asia. CLAUDE.md says the architect adds CI files (.woodpecker/*), so the repo reports no CI. — reported as absent, not blocking (gh#633) - Decision: review the PR and merge? (`codex-svd ship --run-id 20261102T233859Z-7aa0e4ad --confirm-merge`)
Author
Member

Not reproduced on 0.11.0 (48093ca9…e52f, which carries the #149 diagnostics and the linear sign-off redaction), on the same mirror and the same client.

The People Mind mail Source ran two passes against it, because its pod restarted between them. Per-minute counts from the tool call lines; no arguments are logged.

Pass mail_changes phase mail_evidence phase mail_evidence calls
1 7 min 30 min, ended by the client restart about 7,200
2 8 min 35 min and still running at the end of the watch about 8,500

Over 80 minutes: 15,877 mail_evidence calls at the 4/s pacer, slowest 1.8 s; 0 slow tool call lines (threshold 60 s); 0 faulthandler dumps (threshold 20 s); 0 api restarts.

On 0.10.4 the stall came about 18 minutes into the mail_evidence phase, after about 4,300 calls. The client asks in sorted address order, so both passes went well past the address that stalled before.

The ruling-out above showed that the quadratic _ADDRESS regex did not stall the event loop from a worker thread in isolation, so the linear redaction is a candidate fix, not a proven one. Leaving this open for the maintainer: close it, or keep it until a few more full passes have run.

Not reproduced on 0.11.0 (`48093ca9…e52f`, which carries the #149 diagnostics and the linear sign-off redaction), on the same mirror and the same client. The People Mind mail Source ran two passes against it, because its pod restarted between them. Per-minute counts from the `tool call` lines; no arguments are logged. | Pass | `mail_changes` phase | `mail_evidence` phase | `mail_evidence` calls | | --- | --- | --- | --- | | 1 | 7 min | 30 min, ended by the client restart | about 7,200 | | 2 | 8 min | 35 min and still running at the end of the watch | about 8,500 | Over 80 minutes: 15,877 `mail_evidence` calls at the 4/s pacer, slowest 1.8 s; 0 `slow tool call` lines (threshold 60 s); 0 faulthandler dumps (threshold 20 s); 0 `api` restarts. On 0.10.4 the stall came about 18 minutes into the `mail_evidence` phase, after about 4,300 calls. The client asks in sorted address order, so both passes went well past the address that stalled before. The ruling-out above showed that the quadratic `_ADDRESS` regex did not stall the event loop from a worker thread in isolation, so the linear redaction is a candidate fix, not a proven one. Leaving this open for the maintainer: close it, or keep it until a few more full passes have run.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dev/mail-mind-mcp#148
No description provided.