[ 
https://issues.apache.org/jira/browse/DISPATCH-937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16390448#comment-16390448
 ] 

ASF GitHub Bot commented on DISPATCH-937:
-----------------------------------------

GitHub user ganeshmurthy opened a pull request:

    https://github.com/apache/qpid-dispatch/pull/265

    DISPATCH-937 - Introduce the validate flag at the entity level to be …

    …able to avoid validation on already validated entities. This will help 
avoid unnecessary calls to validate.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ganeshmurthy/qpid-dispatch DISPATCH-937-1

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/qpid-dispatch/pull/265.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #265
    
----
commit 6b298414c4466165f23b8f030db0d173892e2b8d
Author: Ganesh Murthy <gmurthy@...>
Date:   2018-03-02T20:01:26Z

    DISPATCH-937 - Introduce the validate flag at the entity level to be able 
to avoid validation on already validated entities. This will help avoid 
unnecessary calls to validate.

----


> schema.validate(attributes) called 4 times before the router starts
> -------------------------------------------------------------------
>
>                 Key: DISPATCH-937
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-937
>             Project: Qpid Dispatch
>          Issue Type: Bug
>          Components: Management Agent
>    Affects Versions: 1.0.1
>            Reporter: Ganesh Murthy
>            Assignee: Ganesh Murthy
>            Priority: Major
>             Fix For: 1.2.0
>
>
> Start the router with the config file etc/qdrouterd.conf. This config file 
> has one router entity
> {noformat}
> router {
>     mode: interior
>     id: Router.A
> }{noformat}
>  
> The schema.validate is called 4 times on the router entity. It should be 
> called only once
>  
> Here is the traceback of the 4 times it was called -
>  
> {noformat}
> {'type': u'org.apache.qpid.dispatch.router', u'mode': u'standalone', u'id': 
> u'Router.A'}
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/config.py",
>  line 142, in configure_dispatch
>     config = Config(filename)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/config.py",
>  line 41, in __init__
>     self.load(filename, raw_json)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/config.py",
>  line 112, in load
>     self.load(f, raw_json)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/config.py",
>  line 120, in load
>     self.schema.validate_all(entities)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/schema.py",
>  line 576, in validate_all
>     self.validate_add(a, entities)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/qdrouter.py",
>  line 53, in validate_add
>     super(QdSchema, self).validate_add(attributes, entities)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/schema.py",
>  line 585, in validate_add
>     self.validate_entity(attributes)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/schema.py",
>  line 568, in validate_entity
>     entity_type.validate(attributes)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/schema.py",
>  line 396, in validate
>     for line in traceback.format_stack():
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/config.py",
>  line 164, in configure_dispatch
>     configure(config.by_type('router')[0])
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/config.py",
>  line 151, in configure
>     agent.configure(attributes)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/agent.py",
>  line 855, in configure
>     self._create(attributes)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/agent.py",
>  line 828, in _create
>     self.add_entity(entity)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/agent.py",
>  line 859, in add_entity
>     self.entities.add(entity)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/agent.py",
>  line 519, in add
>     entity.validate()       # Fill in defaults etc.
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/agent.py",
>  line 171, in validate
>     super(EntityAdapter, self).validate(**kwargs)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/schema.py",
>  line 639, in validate
>     self.entity_type.validate(self.attributes)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/schema.py",
>  line 396, in validate
>     for line in traceback.format_stack():
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/config.py",
>  line 164, in configure_dispatch
>     configure(config.by_type('router')[0])
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/config.py",
>  line 151, in configure
>     agent.configure(attributes)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/agent.py",
>  line 855, in configure
>     self._create(attributes)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/agent.py",
>  line 828, in _create
>     self.add_entity(entity)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/agent.py",
>  line 859, in add_entity
>     self.entities.add(entity)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/agent.py",
>  line 521, in add
>     self.schema.validate_add(entity, self.entities)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/qdrouter.py",
>  line 53, in validate_add
>     super(QdSchema, self).validate_add(attributes, entities)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/schema.py",
>  line 585, in validate_add
>     self.validate_entity(attributes)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/schema.py",
>  line 566, in validate_entity
>     attributes['type'] = self.long_name(attributes['type'])
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/python2.7/site-packages/qpid_dispatch/management/entity.py",
>  line 77, in __setitem__
>     def __setitem__(self, name, value): self._set(name, value)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/schema.py",
>  line 636, in _set
>     self.validate()
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/agent.py",
>  line 171, in validate
>     super(EntityAdapter, self).validate(**kwargs)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/schema.py",
>  line 639, in validate
>     self.entity_type.validate(self.attributes)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/schema.py",
>  line 396, in validate
>     for line in traceback.format_stack():
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/config.py",
>  line 164, in configure_dispatch
>     configure(config.by_type('router')[0])
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/config.py",
>  line 151, in configure
>     agent.configure(attributes)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/agent.py",
>  line 855, in configure
>     self._create(attributes)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/agent.py",
>  line 828, in _create
>     self.add_entity(entity)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/agent.py",
>  line 859, in add_entity
>     self.entities.add(entity)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/agent.py",
>  line 521, in add
>     self.schema.validate_add(entity, self.entities)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/qdrouter.py",
>  line 53, in validate_add
>     super(QdSchema, self).validate_add(attributes, entities)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/schema.py",
>  line 585, in validate_add
>     self.validate_entity(attributes)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/schema.py",
>  line 568, in validate_entity
>     entity_type.validate(attributes)
> File 
> "/home/gmurthy/opensource/qpid-dispatch/install/lib/qpid-dispatch/python/qpid_dispatch_internal/management/schema.py",
>  line 396, in validate
>     for line in traceback.format_stack():{noformat}
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to