Skip to content

Elide async frames in pass-through request pipeline layers - #10621

Merged
tobias-tengler merged 1 commit into
mainfrom
tte/elide-pipeline-async-frames
Oct 20, 2026
Merged

tobias-tengler merged 1 commit into
mainfrom
tte/elide-pipeline-async-frames

Conversation

@tobias-tengler

@tobias-tengler tobias-tengler commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Several request pipeline layers await the next layer only to return afterwards: the document parser, document validation and warmup skip middleware, the instrumentation middleware when no diagnostic listener is registered. Each of them boxes its own async state machine whenever the request suspends, which happens on every subgraph call.

This PR returns the next layer's task directly from these layers. The instrumentation middleware is left out of the pipeline when the registered diagnostic events are the no-op implementation.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Request pipeline layers that have no work after the next layer completes now return
the next layer's task instead of awaiting it, so they no longer allocate an async state
machine box when execution suspends:

- document parser, document validation and warmup skip middleware
- the instrumentation middleware is left out when no diagnostic listener is registered
@tobias-tengler
tobias-tengler force-pushed the tte/elide-pipeline-async-frames branch from 3c528ab to 5aba7c5 Compare October 20, 2026 08:51
@tobias-tengler
tobias-tengler merged commit debbec7 into main Oct 20, 2026
158 checks passed
@tobias-tengler
tobias-tengler deleted the tte/elide-pipeline-async-frames branch October 20, 2026 08:59
@github-actions

Copy link
Copy Markdown
Contributor

Patch coverage

100.0% of changed lines covered (15/15)

File Covered Changed Patch %
…/Core/src/Execution.Pipeline/DocumentParserMiddleware.cs 3 3 100.0% 🟢
…/Core/src/Execution.Pipeline/DocumentValidationMiddleware.cs 3 3 100.0% 🟢
…/Core/src/Execution.Pipeline/InstrumentationMiddleware.cs 7 7 100.0% 🟢
…/Core/src/Execution.Pipeline/SkipWarmupExecutionMiddleware.cs 2 2 100.0% 🟢

Project coverage: 59.1% (312249/528530 lines)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants