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

Ganesh Murthy commented on DISPATCH-411:
----------------------------------------

Alan,
There has been a few changes introduced as part of the introduction of the 
C-management agent - 

The python management agent now listens on the $_management_internal address as 
seen in config.py

{noformat}
agent.activate("$_management_internal")
{noformat}

The C-management agent now listens on $management (code snippet from 
router_core.c)

{noformat}
    //
    // Perform outside-of-thread setup for the management agent
    //
    core->agent_subscription_mobile = qdr_core_subscribe(core, "$management", 
'M', '0',
                                                         
QD_TREATMENT_ANYCAST_CLOSEST,
                                                         
qdr_management_agent_on_message, core);
    core->agent_subscription_local = qdr_core_subscribe(core, "$management", 
'L', '0',
                                                        
QD_TREATMENT_ANYCAST_CLOSEST,
                                                        
qdr_management_agent_on_message, core);

{noformat}

All management requests are intercepted by the C-code first (in 
management_agent.c). 

{noformat}
void qdr_management_agent_on_message(void *context, qd_message_t *msg, int 
unused_link_id, int unused_cost)
     ...
     ....
     if (qd_can_handle_request(properties_fld, &entity_type, &operation_type, 
&identity_iter, &name_iter, &count, &offset)) {
           blah blah blah
     }
     else {
        //
        // The C management agent is not going to handle this request. Forward 
it off to Python agent.
        //
        qdr_send_to2(core, msg, MANAGEMENT_INTERNAL, false, false);     
     }
       
{noformat}

The C code checks to see if can handle that request, otherwise it forwards off 
that request to the python agent (which is listening on $_management_internal)
Type validations are done *only* on requests that go to the Python agent. It is 
true that the Python agent consistently decides what is legal and what 
conversions to do based on the schema but the request does not get there in the 
first place. This is why I think Ted introduced the code in qdmanage that 
converts strings to boolean.

> Boolean options in configs and CLI should be parsed consistently
> ----------------------------------------------------------------
>
>                 Key: DISPATCH-411
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-411
>             Project: Qpid Dispatch
>          Issue Type: Bug
>    Affects Versions: 0.6.0
>            Reporter: Jiri Danek
>            Assignee: Ganesh Murthy
>
> {{waypoint=yes}} is parsed as false. I have to type {{waypoint=true}} for the 
> next command to work. In config file, {{waypoint: yes}} does work.
> {quote}$ qdmanage create --type address prefix=jmse.queue waypoint=yes
>   "name": null,
>   "prefix": "jmse.queue",
>   "ingressPhase": 0,
>   "waypoint": false,
>   "distribution": "balanced",
>   "type": "org.apache.qpid.dispatch.router.config.address",
>   "identity": "27",
>   "egressPhase": 0
> {quote}
> There seem to be two places that parse Boolean options. First is the conf 
> file 
> https://github.com/apache/qpid-dispatch/blob/b5ca35fc770262850cec2b7bd134a667fd713fff/python/qpid_dispatch_internal/management/schema.py#L83,
>  which recognizes (case insensitively) "yes, true, on, 1" as truthy values, 
> "no, false, off, 0" as falsey values. Anything else is an error.
> Second is 
> https://github.com/apache/qpid-dispatch/blob/2b1d8f67f3ad5dd25edaf8fc71117988a14e102d/run.py.in#L91.
>  which recognizes (again case insensitively) "on, yes, 1" as truthy and 
> everything else falsey (no error)
> Finally, qdmanage 
> https://github.com/apache/qpid-dispatch/blob/9c4933ffbd4821e55b0dc870c254d55eecffea89/tools/qdmanage#L34
>  recognizes (case sensitive, this time) only "true", and anything else is 
> considered to be falsey. 
> I'd wish this to be more consistent.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to