You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug GENERATOR_STATS is a singleton (with global class attributes) but is mutated freely. If the schema (with errors or warnings) is generated concurrently (e.g. by SpectacularAPIView) exceptions and/or invalid traces can occur.
To Reproduce
Create a schema with at least one warning or error, add an API view and then run
while true; do
if ! curl http://localhost:8000/api/schema/ -s --fail > /dev/null; then
break
fi
done
in multiple bash shells against the schema URL in parallel -- eventually requests will fail.
Expected behavior
API views and schema generation are thread-safe.
The text was updated successfully, but these errors were encountered:
Describe the bug
GENERATOR_STATS
is a singleton (with global class attributes) but is mutated freely. If the schema (with errors or warnings) is generated concurrently (e.g. bySpectacularAPIView
) exceptions and/or invalid traces can occur.To Reproduce
Create a schema with at least one warning or error, add an API view and then run
in multiple bash shells against the schema URL in parallel -- eventually requests will fail.
Expected behavior
API views and schema generation are thread-safe.
The text was updated successfully, but these errors were encountered: