Uploaded image for project: 'Qpid Dispatch'
  1. Qpid Dispatch
  2. DISPATCH-205

Schema.validate() called many times

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.6.0
    • None
    • Management Agent
    • 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.

      Attachments

        Activity

          People

            aconway Alan Conway
            chug Charles E. Rolke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: