Repository navigation
fix: initialize model factories before concurrent reuse - #8347
RKS (rksharma-owg) wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The narrowly scoped lifecycle change preserves existing mapping behavior and is covered by a deterministic regression test.
Review effort: Balanced
Findings: None
What changed in this PR
Moves model factory initialization before model publication to prevent concurrent C#/Go backward-compatible response generation failures.
Changes:
- Initializes factory signatures before shared-model reuse.
- Populates discriminator mappings after property discovery.
- Adds deterministic concurrency regression coverage and changelog documentation.
| File | Description |
|---|---|
src/Kiota.Builder/KiotaBuilder.cs |
Fixes concurrent factory availability. |
tests/Kiota.Builder.Tests/KiotaBuilderTests.ModelFactory.cs |
Tests controlled C#/Go interleaving. |
CHANGELOG.md |
Documents the fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟢 Approval recommended
The targeted initialization change resolves the race while preserving mapping behavior and includes focused regression coverage.
0 open findings
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
|
The failed Notion/PHP job reports |
Head branch was pushed to by a user without write access
|
Conflicts have been resolved. A maintainer will take a look shortly. |
Fixes #6854.
Parallel endpoints can reuse a response model before its discriminator factory exists. The backward-compatible C#/Go response path immediately clones that factory and can throw
Sequence contains no matching element.Initialize the factory signature alongside serialization members before publishing the model. Populate discriminator mappings after property discovery as before. No waits or lifecycle locks are added. The changelog entry remains under Unreleased.
Validation for
be0b847e5b0ecfdb2509994fa35e1ccfc870ac0cagainst main1b6cb197f1ba48f4298477eaab4e6be73b13294b:Existing upstream suppressions and analyzers are unchanged. Approval-held upstream workflows remain separate from completed fork validation.