Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
Do not delete mock validator/serializer inmodel_rebuild()
#11890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
`pydantic-core` won't use them anyway as it checks for `__pydantic_complete__`first. This is done in order to avoid concurrency issues, where a concurrentmodel instantiation would use the validator from a parent class if the`model_rebuild()` call haven't finished in another thread.
Deploying pydantic-docs with |
Latest commit: | 42175f7 |
Status: | ✅ Deploy successful! |
Preview URL: | https://9bc7b193.pydantic-docs.pages.dev |
Branch Preview URL: | https://rebuild-mock.pydantic-docs.pages.dev |
CodSpeed Performance ReportMerging#11890 willnot alter performanceComparing Summary
|
Coverage reportClick to see where and how coverage changed
This report was generated bypython-coverage-comment-action |
Does this mean that multiple threads might start rebuilding at the same time? Such a race seems not ideal. |
Yes, but this was already the case before 2.11. It isn't ideal as it can result in multiple unnecessary rebuilds, but seems like this is somewhat safe as we got no reports about this before. |
0a21ab1
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
pydantic-core
won't use them anyway as it checks for__pydantic_complete__
first. This is done in order to avoid concurrency issues, where a concurrent model instantiation would use the validator from a parent class if themodel_rebuild()
call did not finish in another thread.Change Summary
Fixes#11849, regression in#11429, alternative to#11851.
Related issue number
Checklist