Skip to content

PyPy: a long chain of nested model classes ends the process when Citry builds its validator copy #854

Backlog

Description

@JuroOravec

On PyPy, a chain of 150 to 200 Pydantic model classes nested inside each other (A has a field of type B, B of type C, and so on) ends the process while Citry builds its copy of the validator the first time an event uses the class. On CPython the chain works.

The model classes come from the app's own code, so only the app author can trigger it.

The test test_the_copy_of_a_chain_of_nested_models_is_built_on_a_thread_with_a_small_stack is skipped on PyPy for this reason (#851).

Possible fixes: build the copy without recursing once per class, refuse a chain deeper than PyPy can build with a clear error, or document the limit in "Differences on PyPy" in docs_site/content/about/compatibility.md. Related: #708.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions