Repository navigation
fix: initialize model factories before concurrent reuse - #8347
RKS (rksharma-owg) wants to merge 3 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.
|
Conflicts have been resolved. A maintainer will take a look shortly. |
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.
Fixes #6854.
Parallel endpoints can reuse a response model after it has been added to its namespace but before its discriminator factory exists. The backward-compatible C#/Go response path immediately clones that factory, so the lookup intermittently throws
Sequence contains no matching element.Initialize the factory signature alongside the serialization members before publishing the model. Populate discriminator mappings after property discovery as before. No new waits or lifecycle locks are introduced.
Merged current
main(b6f532aee) to resolve conflicts, preserving upstream changes and the focused three-file contribution.Validation of
1ee39484a4268734dc4a8f965a7ba908826b8fb8: