Make _store_schema_list thread safe #1032
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm using
jsonschema
throughaltair
and as of version 4.17.1 I've been occasionally running into issues when generating plots in parallel (using threading): The commit that broke things for me is 4f8f3, where it makes a difference for me if I'm calling.append(...)
in a loop or.extend(...)
only once. The reason is that some of my threads end up with an incomplete list of_VOCABULARIES
.I understand that
jsonschema
is not advertising to be threadsafe (xref #464), but would you still consider merging this patch? I'm imitating the style of_store_schema_list
from before 4f8f346.I should add that my patch doesn't make the function thread safe, just a little bit thread safer.
📚 Documentation preview 📚: https://python-jsonschema--1032.org.readthedocs.build/en/1032/