You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Alan Conway (JIRA)" <ji...@apache.org> on 2016/04/04 20:33:25 UTC
[jira] [Updated] (DISPATCH-205) Schema.validate() called many times
[ https://issues.apache.org/jira/browse/DISPATCH-205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alan Conway updated DISPATCH-205:
---------------------------------
Fix Version/s: 0.6
> Schema.validate() called many times
> -----------------------------------
>
> Key: DISPATCH-205
> URL: https://issues.apache.org/jira/browse/DISPATCH-205
> Project: Qpid Dispatch
> Issue Type: Bug
> Components: Management Agent
> Affects Versions: 0.6
> Environment: Current master branch
> Reporter: Chuck Rolke
> Assignee: Alan Conway
> Fix For: 0.6
>
>
> 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
> {noformat}
> --- 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))
> {noformat}
> Then launch qdrouterd using one of the built-in configs with command line
> {noformat}
> /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
> {noformat}
> SCHEMA VALIDATE is printed 9,465 times.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org