Skip to content

Flush analytics before in-process app server shutdown - #34831

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/57ca24e535e5e2f3f3202b2e5498f075676c910a
Jul 22, 2026
Merged

Flush analytics before in-process app server shutdown#34831
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/57ca24e535e5e2f3f3202b2e5498f075676c910a

Conversation

@copyberry

@copyberry copyberry Bot commented Jul 22, 2026

Copy link
Copy Markdown

Flush analytics before in-process app server shutdown

Why

The in-process app server can shut down while analytics for a completed turn are
still queued, preventing the completed-turn and accepted-line events from being
delivered.

What changed

  • Add a bounded analytics queue flush that waits for all preceding facts to be
    processed.
  • Flush analytics after the in-process runtime drains its outbound work and
    before acknowledging shutdown.
  • Extend the in-process shutdown timeout budgets to cover runtime draining and
    the best-effort analytics flush.

Testing

  • Verify that the flush waits for preceding facts and is a no-op when analytics
    is disabled.
  • Verify that shutdown waits for delayed analytics delivery, including the
    completed-turn and accepted-line events produced by a file change.

## Why

The in-process app server can shut down while analytics for a completed turn are
still queued, preventing the completed-turn and accepted-line events from being
delivered.

## What changed

- Add a bounded analytics queue flush that waits for all preceding facts to be
  processed.
- Flush analytics after the in-process runtime drains its outbound work and
  before acknowledging shutdown.
- Extend the in-process shutdown timeout budgets to cover runtime draining and
  the best-effort analytics flush.

## Testing

- Verify that the flush waits for preceding facts and is a no-op when analytics
  is disabled.
- Verify that shutdown waits for delayed analytics delivery, including the
  completed-turn and accepted-line events produced by a file change.

GitOrigin-RevId: 57ca24e535e5e2f3f3202b2e5498f075676c910a
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/57ca24e535e5e2f3f3202b2e5498f075676c910a branch from b22569a to 88f1cd9 Compare July 22, 2026 21:35
@copyberry
copyberry Bot merged commit 88f1cd9 into main Jul 22, 2026
29 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/57ca24e535e5e2f3f3202b2e5498f075676c910a branch July 22, 2026 21:37
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants