[ 
https://issues.apache.org/jira/browse/DISPATCH-205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ted Ross updated DISPATCH-205:
------------------------------
    Fix Version/s:     (was: 0.6)
                   0.7

> 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.7
>
>
> 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-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to