Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.6.0
-
None
-
None
-
Current master branch
Description
Debugging in schema.py reveals that function Validate is called thousands of times for a small config file. Maybe for a small config file this is OK but if there is some unexpected recursion then a larger config file might take too long.
Test it with this patch
--- a/python/qpid_dispatch_internal/management/schema.py +++ b/python/qpid_dispatch_internal/management/schema.py @@ -257,6 +257,7 @@ class AttributeType(object): @param kwargs: See L{Schema.validate_all} @return: value converted to the correct python type. Rais exception if any check fails. """ + print("SCHEMA VALIDATE: %s" % value) value = resolve(value) if self.unique and not _is_unique(check_unique, (self.name, value)): raise ValidationError("Duplicate value '%s' for unique attribute '%s'"%(value, self.name))
Then launch qdrouterd using one of the built-in configs with command line
/home/git/qpid-dispatch/build/router/qdrouterd \ -c /home/git/qpid-dispatch/build/tests/config-2/A-ssl.conf \ -I /home/git/qpid-dispatch/python
SCHEMA VALIDATE is printed 9,465 times.