capnproto / pycapnp

Cap'n Proto serialization/RPC system - Python bindings
BSD 2-Clause "Simplified" License
458 stars 125 forks source link

List all imported schemas? #357

Open tpt5cu opened 3 months ago

tpt5cu commented 3 months ago

My team and I encountered a nasty capnp issue. We have a python application running in a multithreaded environment. Nominally, we dynamically import capnp schemas at runtime, populate them, send our serialized data, and all is good.

However I noticed that if bugs were encountered in the serialization process, sometimes these capnp schemas were not released from the global_schema_parser.

We were able to fix these issues by running capnp.cleanup_global_schema_parser(), but this hunch was more of guess and check than anything.

Is there a way to list all imported schemas ? How does capnp ensure that imported schemas are properly released from the GIL when a python thread exits ?