[jira] [Commented] (DISPATCH-1569) Add total memory usage to router management entity

2020-02-11 Thread Charles E. Rolke (Jira)


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

Charles E. Rolke commented on DISPATCH-1569:


See also DISPATCH-1415

> Add total memory usage to router management entity
> --
>
> Key: DISPATCH-1569
> URL: https://issues.apache.org/jira/browse/DISPATCH-1569
> Project: Qpid Dispatch
>  Issue Type: New Feature
>  Components: Management Agent, Router Node, Tools
>Affects Versions: 1.10.0
>Reporter: Ken Giusti
>Assignee: Ken Giusti
>Priority: Minor
> Fix For: Backlog
>
>
> It would be useful to be able to access the current overall memory usage of 
> the qdrouterd process via management.
> This proposal would include
>  * add a in-use memory gauge to the org.apache.qpid.dispatch.router entity
>  * add a max available memory gauge to the same entity (optional)
>  * integrate these values into the qdstat -m output
> These gauges should report back "0" if the platform does not provide the 
> ability to access these metrics in process.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Commented] (DISPATCH-1566) safe_snpritf is not safe.

2020-02-11 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on DISPATCH-1566:
--

nicob87 commented on issue #679: DISPATCH-1566: fix safe_snptrintf
URL: https://github.com/apache/qpid-dispatch/pull/679#issuecomment-584812640
 
 
   Test error is only in the RelWithDebInfo build, and it is in the tear down, 
If I am not wrong it is not related to this pr.
   
   ```
   51: ==
   51: ERROR: tearDownClass (system_tests_edge_router.LinkRouteProxyTest)
   51: --
   51: Traceback (most recent call last):
   51:   File "/home/travis/build/apache/qpid-dispatch/tests/system_test.py", 
line 691, in tearDownClass
   51: cls.tester.teardown()
   51:   File "/home/travis/build/apache/qpid-dispatch/tests/system_test.py", 
line 637, in teardown
   51: raise RuntimeError("Errors during teardown: \n\n%s" % 
"\n\n".join([str(e) for e in errors]))
   51: RuntimeError: Errors during teardown: 
   51: 
   51: Process 14088 error: exit code 23, expected 0
   51: qdrouterd -c EB1.conf -I /home/travis/build/apache/qpid-dispatch/python
   51: 
/home/travis/build/apache/qpid-dispatch/build/tests/system_test.dir/system_tests_edge_router/LinkRouteProxyTest/setUpClass/EB1-8.cmd
   51: 
   ```
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> safe_snpritf is not safe.
> -
>
> Key: DISPATCH-1566
> URL: https://issues.apache.org/jira/browse/DISPATCH-1566
> Project: Qpid Dispatch
>  Issue Type: Bug
>  Components: Router Node
>Affects Versions: 1.10.0
>Reporter: Nicolas
>Priority: Major
> Fix For: 1.11.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> {{/*  */}}
> {{static inline int safe_snprintf(char *str, size_t size, const char *format, 
> ...)}}
> {{{  }}{{}}}
> This function fails for size = 0, and ... inside it calls vsnprintf, without 
> considering that in case of error vsnprintf returns a negative number.
> PR in progress.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[GitHub] [qpid-dispatch] nicob87 commented on issue #679: DISPATCH-1566: fix safe_snptrintf

2020-02-11 Thread GitBox
nicob87 commented on issue #679: DISPATCH-1566: fix safe_snptrintf
URL: https://github.com/apache/qpid-dispatch/pull/679#issuecomment-584812640
 
 
   Test error is only in the RelWithDebInfo build, and it is in the tear down, 
If I am not wrong it is not related to this pr.
   
   ```
   51: ==
   51: ERROR: tearDownClass (system_tests_edge_router.LinkRouteProxyTest)
   51: --
   51: Traceback (most recent call last):
   51:   File "/home/travis/build/apache/qpid-dispatch/tests/system_test.py", 
line 691, in tearDownClass
   51: cls.tester.teardown()
   51:   File "/home/travis/build/apache/qpid-dispatch/tests/system_test.py", 
line 637, in teardown
   51: raise RuntimeError("Errors during teardown: \n\n%s" % 
"\n\n".join([str(e) for e in errors]))
   51: RuntimeError: Errors during teardown: 
   51: 
   51: Process 14088 error: exit code 23, expected 0
   51: qdrouterd -c EB1.conf -I /home/travis/build/apache/qpid-dispatch/python
   51: 
/home/travis/build/apache/qpid-dispatch/build/tests/system_test.dir/system_tests_edge_router/LinkRouteProxyTest/setUpClass/EB1-8.cmd
   51: 
   ```
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[jira] [Commented] (DISPATCH-1530) system_tests_multi_tenancy fails occasionally

2020-02-11 Thread Charles E. Rolke (Jira)


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

Charles E. Rolke commented on DISPATCH-1530:


Also attached are the router B.log log lines mentioning Auto Link during the 
failed test.

> system_tests_multi_tenancy fails occasionally 
> --
>
> Key: DISPATCH-1530
> URL: https://issues.apache.org/jira/browse/DISPATCH-1530
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Tests
>Affects Versions: 1.9.0
>Reporter: Ganesh Murthy
>Assignee: Charles E. Rolke
>Priority: Major
> Fix For: 1.11.0
>
> Attachments: DISPATCH-1530-autolink-log-lines.txt, 
> DISPATCH-1530-test2-log.txt
>
>
> FAIL: test_36_two_router_waypoint_external_addr 
> (system_tests_multi_tenancy.RouterTest)
> --
> Traceback (most recent call last):
>  File "/foo/qpid-dispatch/tests/system_tests_multi_tenancy.py", line 459, in 
> test_36_two_router_waypoint_external_addr
>  self.assertEqual(None, test.error)
> AssertionError: None != u'Timeout Expired: n_sent=10 n_rcvd=8 n_thru=8'
> --
> Ran 36 tests in 73.577s



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Updated] (DISPATCH-1530) system_tests_multi_tenancy fails occasionally

2020-02-11 Thread Charles E. Rolke (Jira)


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

Charles E. Rolke updated DISPATCH-1530:
---
Attachment: DISPATCH-1530-autolink-log-lines.txt

> system_tests_multi_tenancy fails occasionally 
> --
>
> Key: DISPATCH-1530
> URL: https://issues.apache.org/jira/browse/DISPATCH-1530
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Tests
>Affects Versions: 1.9.0
>Reporter: Ganesh Murthy
>Assignee: Charles E. Rolke
>Priority: Major
> Fix For: 1.11.0
>
> Attachments: DISPATCH-1530-autolink-log-lines.txt, 
> DISPATCH-1530-test2-log.txt
>
>
> FAIL: test_36_two_router_waypoint_external_addr 
> (system_tests_multi_tenancy.RouterTest)
> --
> Traceback (most recent call last):
>  File "/foo/qpid-dispatch/tests/system_tests_multi_tenancy.py", line 459, in 
> test_36_two_router_waypoint_external_addr
>  self.assertEqual(None, test.error)
> AssertionError: None != u'Timeout Expired: n_sent=10 n_rcvd=8 n_thru=8'
> --
> Ran 36 tests in 73.577s



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Updated] (DISPATCH-1530) system_tests_multi_tenancy fails occasionally

2020-02-11 Thread Charles E. Rolke (Jira)


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

Charles E. Rolke updated DISPATCH-1530:
---
Attachment: DISPATCH-1530-test2-log.txt

> system_tests_multi_tenancy fails occasionally 
> --
>
> Key: DISPATCH-1530
> URL: https://issues.apache.org/jira/browse/DISPATCH-1530
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Tests
>Affects Versions: 1.9.0
>Reporter: Ganesh Murthy
>Assignee: Charles E. Rolke
>Priority: Major
> Fix For: 1.11.0
>
> Attachments: DISPATCH-1530-test2-log.txt
>
>
> FAIL: test_36_two_router_waypoint_external_addr 
> (system_tests_multi_tenancy.RouterTest)
> --
> Traceback (most recent call last):
>  File "/foo/qpid-dispatch/tests/system_tests_multi_tenancy.py", line 459, in 
> test_36_two_router_waypoint_external_addr
>  self.assertEqual(None, test.error)
> AssertionError: None != u'Timeout Expired: n_sent=10 n_rcvd=8 n_thru=8'
> --
> Ran 36 tests in 73.577s



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Commented] (DISPATCH-1530) system_tests_multi_tenancy fails occasionally

2020-02-11 Thread Charles E. Rolke (Jira)


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

Charles E. Rolke commented on DISPATCH-1530:


WaypointTest was instrumented to produce some more detailed logging.

The first failure observed was that messages sent by send_client were released. 
With no messages passing through to the waypoint the test times out. A 
workaround 
([https://github.com/ChugR/qpid-dispatch/blob/cr-DISPATCH-1530/tests/system_tests_multi_tenancy.py)]
 was added to compensate for the released messages by sending something, not 
the original message but some message nonetheless.

That triggered a second failure where messages sent by send_waypoint were 
released. There was no compensation in the test for those released messages so 
the test went on to time out. However, along the way an unusual autoLink event 
cropped up: Five seconds into the test two more autolinks from router B were 
created to the ALC container. Now there are four active links, two sender links 
and two receiver links. No traffic passed over any of the links before the test 
timed out.

A log of the test and the test events is attached.

> system_tests_multi_tenancy fails occasionally 
> --
>
> Key: DISPATCH-1530
> URL: https://issues.apache.org/jira/browse/DISPATCH-1530
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Tests
>Affects Versions: 1.9.0
>Reporter: Ganesh Murthy
>Assignee: Charles E. Rolke
>Priority: Major
> Fix For: 1.11.0
>
>
> FAIL: test_36_two_router_waypoint_external_addr 
> (system_tests_multi_tenancy.RouterTest)
> --
> Traceback (most recent call last):
>  File "/foo/qpid-dispatch/tests/system_tests_multi_tenancy.py", line 459, in 
> test_36_two_router_waypoint_external_addr
>  self.assertEqual(None, test.error)
> AssertionError: None != u'Timeout Expired: n_sent=10 n_rcvd=8 n_thru=8'
> --
> Ran 36 tests in 73.577s



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Updated] (DISPATCH-1570) Enable -Wconversion gcc compiler flag

2020-02-11 Thread Ganesh Murthy (Jira)


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

Ganesh Murthy updated DISPATCH-1570:

Fix Version/s: (was: 1.11.0)

> Enable -Wconversion gcc compiler flag
> -
>
> Key: DISPATCH-1570
> URL: https://issues.apache.org/jira/browse/DISPATCH-1570
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Router Node
>Reporter: Nicolas
>Priority: Major
>
> Right now we are compiling without this flag, which is gcc default but also 
> quite "error prone".
> The idea is to work through the implicit conversions we have and just using a 
> casting when we really want a conversion, making it explicit. And not doing 
> it another way.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Updated] (DISPATCH-1570) Enable -Wconversion gcc compiler flag

2020-02-11 Thread Ganesh Murthy (Jira)


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

Ganesh Murthy updated DISPATCH-1570:

Affects Version/s: 1.10.0

> Enable -Wconversion gcc compiler flag
> -
>
> Key: DISPATCH-1570
> URL: https://issues.apache.org/jira/browse/DISPATCH-1570
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Router Node
>Affects Versions: 1.10.0
>Reporter: Nicolas
>Priority: Major
>
> Right now we are compiling without this flag, which is gcc default but also 
> quite "error prone".
> The idea is to work through the implicit conversions we have and just using a 
> casting when we really want a conversion, making it explicit. And not doing 
> it another way.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Commented] (DISPATCH-1566) safe_snpritf is not safe.

2020-02-11 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on DISPATCH-1566:
--

nicob87 commented on pull request #679: DISPATCH-1566: fix safe_snptrintf
URL: https://github.com/apache/qpid-dispatch/pull/679
 
 
   As it is explained in 
[DISPATCH-1566](https://issues.apache.org/jira/browse/DISPATCH-1566):
   "This function fails for size = 0, and ... inside it calls vsnprintf, 
without considering that in case of error vsnprintf returns a negative number."
   
   So after fix we can expect this behaviour:
   - (size = 0) -> safe_snprintf returns 0, and does nothing. 
   - (size > INT_MAX) -> safe_snprintf returns 0, and does nothing. Since inner 
vsnprintf function returns int, it has no sense (and it may produce an error) 
to accept size > INT_MAX.
   - (inner vsnprintf return value > (size -1)) -> safe_snprintf returns 
(size-1) -> which is the max possible value.
   - (inner vsnprintf returns negative number) -> safe_snprintf returns 0. 
there was a parsing error.
   - (inner vsnprintf return value >= 0 and < (size-1)) -> safe_snprintf 
returns vsnprintf.
   
   This behaviour has been unit-tested but those changes will be included in 
other pr that is blocked by: 
   [DISPATCH-1568](https://issues.apache.org/jira/browse/DISPATCH-1568)
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> safe_snpritf is not safe.
> -
>
> Key: DISPATCH-1566
> URL: https://issues.apache.org/jira/browse/DISPATCH-1566
> Project: Qpid Dispatch
>  Issue Type: Bug
>  Components: Router Node
>Affects Versions: 1.10.0
>Reporter: Nicolas
>Priority: Major
> Fix For: 1.11.0
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> {{/*  */}}
> {{static inline int safe_snprintf(char *str, size_t size, const char *format, 
> ...)}}
> {{{  }}{{}}}
> This function fails for size = 0, and ... inside it calls vsnprintf, without 
> considering that in case of error vsnprintf returns a negative number.
> PR in progress.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[GitHub] [qpid-dispatch] nicob87 opened a new pull request #679: DISPATCH-1566: fix safe_snptrintf

2020-02-11 Thread GitBox
nicob87 opened a new pull request #679: DISPATCH-1566: fix safe_snptrintf
URL: https://github.com/apache/qpid-dispatch/pull/679
 
 
   As it is explained in 
[DISPATCH-1566](https://issues.apache.org/jira/browse/DISPATCH-1566):
   "This function fails for size = 0, and ... inside it calls vsnprintf, 
without considering that in case of error vsnprintf returns a negative number."
   
   So after fix we can expect this behaviour:
   - (size = 0) -> safe_snprintf returns 0, and does nothing. 
   - (size > INT_MAX) -> safe_snprintf returns 0, and does nothing. Since inner 
vsnprintf function returns int, it has no sense (and it may produce an error) 
to accept size > INT_MAX.
   - (inner vsnprintf return value > (size -1)) -> safe_snprintf returns 
(size-1) -> which is the max possible value.
   - (inner vsnprintf returns negative number) -> safe_snprintf returns 0. 
there was a parsing error.
   - (inner vsnprintf return value >= 0 and < (size-1)) -> safe_snprintf 
returns vsnprintf.
   
   This behaviour has been unit-tested but those changes will be included in 
other pr that is blocked by: 
   [DISPATCH-1568](https://issues.apache.org/jira/browse/DISPATCH-1568)


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[jira] [Commented] (DISPATCH-1518) Add ability to turn on router trace logging for a specific connection

2020-02-11 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on DISPATCH-1518:
--

ChugR commented on pull request #676: DISPATCH-1518: Added ability to turn on 
protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377764623
 
 

 ##
 File path: src/router_node.c
 ##
 @@ -1432,6 +1432,30 @@ static void CORE_link_second_attach(void *context, 
qdr_link_t *link, qdr_terminu
 qdr_link_stalled_outbound(link);
 }
 
+
+static void CORE_conn_trace(void *context, qdr_connection_t *qdr_conn, bool 
trace)
+{
+qd_connection_t  *qconn  = (qd_connection_t*) 
qdr_connection_get_context(qdr_conn);
+
+if (!qconn)
+return;
+
+pn_transport_t *tport  = pn_connection_transport(qconn->pn_conn);
+
+if (!tport)
+return;
+
+if (trace) {
+pn_transport_trace(tport, PN_TRACE_FRM);
+pn_transport_set_tracer(tport, connection_transport_tracer);
+
+}
+else {
+pn_transport_set_tracer(tport, 0);
 
 Review comment:
   When pn_tracer_t tracer is zero then an assert triggers in the proton code.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add ability to turn on router trace logging for a specific connection 
> --
>
> Key: DISPATCH-1518
> URL: https://issues.apache.org/jira/browse/DISPATCH-1518
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.9.0
>Reporter: Ganesh Murthy
>Assignee: Ganesh Murthy
>Priority: Major
> Fix For: 1.11.0
>
>
> It would be nice to be able to turn on tracing per connection, e.g. something 
> like `qdmanage update --type=connection id=897644 tracing=true`
> That way you could benefit from protocol level tracing on connections of 
> interest as and when needed. Perhaps also there could be some way of 
> specifying a policy for connection tracing, e.g. all connections whose 
> container id is 'foo' or who are connecting from 192.666.555.444 or similar.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[GitHub] [qpid-dispatch] ChugR commented on a change in pull request #676: DISPATCH-1518: Added ability to turn on protocol frame trace logging …

2020-02-11 Thread GitBox
ChugR commented on a change in pull request #676: DISPATCH-1518: Added ability 
to turn on protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377764623
 
 

 ##
 File path: src/router_node.c
 ##
 @@ -1432,6 +1432,30 @@ static void CORE_link_second_attach(void *context, 
qdr_link_t *link, qdr_terminu
 qdr_link_stalled_outbound(link);
 }
 
+
+static void CORE_conn_trace(void *context, qdr_connection_t *qdr_conn, bool 
trace)
+{
+qd_connection_t  *qconn  = (qd_connection_t*) 
qdr_connection_get_context(qdr_conn);
+
+if (!qconn)
+return;
+
+pn_transport_t *tport  = pn_connection_transport(qconn->pn_conn);
+
+if (!tport)
+return;
+
+if (trace) {
+pn_transport_trace(tport, PN_TRACE_FRM);
+pn_transport_set_tracer(tport, connection_transport_tracer);
+
+}
+else {
+pn_transport_set_tracer(tport, 0);
 
 Review comment:
   When pn_tracer_t tracer is zero then an assert triggers in the proton code.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[jira] [Commented] (DISPATCH-1518) Add ability to turn on router trace logging for a specific connection

2020-02-11 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on DISPATCH-1518:
--

ChugR commented on pull request #676: DISPATCH-1518: Added ability to turn on 
protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377764623
 
 

 ##
 File path: src/router_node.c
 ##
 @@ -1432,6 +1432,30 @@ static void CORE_link_second_attach(void *context, 
qdr_link_t *link, qdr_terminu
 qdr_link_stalled_outbound(link);
 }
 
+
+static void CORE_conn_trace(void *context, qdr_connection_t *qdr_conn, bool 
trace)
+{
+qd_connection_t  *qconn  = (qd_connection_t*) 
qdr_connection_get_context(qdr_conn);
+
+if (!qconn)
+return;
+
+pn_transport_t *tport  = pn_connection_transport(qconn->pn_conn);
+
+if (!tport)
+return;
+
+if (trace) {
+pn_transport_trace(tport, PN_TRACE_FRM);
+pn_transport_set_tracer(tport, connection_transport_tracer);
+
+}
+else {
+pn_transport_set_tracer(tport, 0);
 
 Review comment:
   When pn_tracer_t tracer is zero the an assert triggers in the proton code.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add ability to turn on router trace logging for a specific connection 
> --
>
> Key: DISPATCH-1518
> URL: https://issues.apache.org/jira/browse/DISPATCH-1518
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.9.0
>Reporter: Ganesh Murthy
>Assignee: Ganesh Murthy
>Priority: Major
> Fix For: 1.11.0
>
>
> It would be nice to be able to turn on tracing per connection, e.g. something 
> like `qdmanage update --type=connection id=897644 tracing=true`
> That way you could benefit from protocol level tracing on connections of 
> interest as and when needed. Perhaps also there could be some way of 
> specifying a policy for connection tracing, e.g. all connections whose 
> container id is 'foo' or who are connecting from 192.666.555.444 or similar.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[GitHub] [qpid-dispatch] ChugR commented on a change in pull request #676: DISPATCH-1518: Added ability to turn on protocol frame trace logging …

2020-02-11 Thread GitBox
ChugR commented on a change in pull request #676: DISPATCH-1518: Added ability 
to turn on protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377764623
 
 

 ##
 File path: src/router_node.c
 ##
 @@ -1432,6 +1432,30 @@ static void CORE_link_second_attach(void *context, 
qdr_link_t *link, qdr_terminu
 qdr_link_stalled_outbound(link);
 }
 
+
+static void CORE_conn_trace(void *context, qdr_connection_t *qdr_conn, bool 
trace)
+{
+qd_connection_t  *qconn  = (qd_connection_t*) 
qdr_connection_get_context(qdr_conn);
+
+if (!qconn)
+return;
+
+pn_transport_t *tport  = pn_connection_transport(qconn->pn_conn);
+
+if (!tport)
+return;
+
+if (trace) {
+pn_transport_trace(tport, PN_TRACE_FRM);
+pn_transport_set_tracer(tport, connection_transport_tracer);
+
+}
+else {
+pn_transport_set_tracer(tport, 0);
 
 Review comment:
   When pn_tracer_t tracer is zero the an assert triggers in the proton code.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[jira] [Commented] (DISPATCH-1518) Add ability to turn on router trace logging for a specific connection

2020-02-11 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on DISPATCH-1518:
--

ganeshmurthy commented on pull request #676: DISPATCH-1518: Added ability to 
turn on protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377746563
 
 

 ##
 File path: python/qpid_dispatch/management/client.py
 ##
 @@ -76,6 +76,16 @@ def delete(self):
 class Node(object):
 """Client proxy for an AMQP management node"""
 
+def clean_attrs(self, attrs):
+BOOL_VALUES = {"yes": 1, "true": 1, "on": 1, "no": 0, "false": 0,
 
 Review comment:
   This is tough question. I think 'Yes' should be invalid, so should 'YES' or 
'YEs' or 'NO' or 'No'
   Please let me know what your thoughts on that are.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add ability to turn on router trace logging for a specific connection 
> --
>
> Key: DISPATCH-1518
> URL: https://issues.apache.org/jira/browse/DISPATCH-1518
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.9.0
>Reporter: Ganesh Murthy
>Assignee: Ganesh Murthy
>Priority: Major
> Fix For: 1.11.0
>
>
> It would be nice to be able to turn on tracing per connection, e.g. something 
> like `qdmanage update --type=connection id=897644 tracing=true`
> That way you could benefit from protocol level tracing on connections of 
> interest as and when needed. Perhaps also there could be some way of 
> specifying a policy for connection tracing, e.g. all connections whose 
> container id is 'foo' or who are connecting from 192.666.555.444 or similar.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[GitHub] [qpid-dispatch] ganeshmurthy commented on a change in pull request #676: DISPATCH-1518: Added ability to turn on protocol frame trace logging …

2020-02-11 Thread GitBox
ganeshmurthy commented on a change in pull request #676: DISPATCH-1518: Added 
ability to turn on protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377746563
 
 

 ##
 File path: python/qpid_dispatch/management/client.py
 ##
 @@ -76,6 +76,16 @@ def delete(self):
 class Node(object):
 """Client proxy for an AMQP management node"""
 
+def clean_attrs(self, attrs):
+BOOL_VALUES = {"yes": 1, "true": 1, "on": 1, "no": 0, "false": 0,
 
 Review comment:
   This is tough question. I think 'Yes' should be invalid, so should 'YES' or 
'YEs' or 'NO' or 'No'
   Please let me know what your thoughts on that are.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[jira] [Created] (DISPATCH-1570) Enable -Wconversion gcc compiler flag

2020-02-11 Thread Nicolas (Jira)
Nicolas created DISPATCH-1570:
-

 Summary: Enable -Wconversion gcc compiler flag
 Key: DISPATCH-1570
 URL: https://issues.apache.org/jira/browse/DISPATCH-1570
 Project: Qpid Dispatch
  Issue Type: Improvement
  Components: Router Node
Reporter: Nicolas
 Fix For: 1.11.0


Right now we are compiling without this flag, which is gcc default but also 
quite "error prone".

The idea is to work through the implicit conversions we have and just using a 
casting when we really want a conversion, making it explicit. And not doing it 
another way.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Created] (DISPATCH-1569) Add total memory usage to router management entity

2020-02-11 Thread Ken Giusti (Jira)
Ken Giusti created DISPATCH-1569:


 Summary: Add total memory usage to router management entity
 Key: DISPATCH-1569
 URL: https://issues.apache.org/jira/browse/DISPATCH-1569
 Project: Qpid Dispatch
  Issue Type: New Feature
  Components: Management Agent, Router Node, Tools
Affects Versions: 1.10.0
Reporter: Ken Giusti
Assignee: Ken Giusti
 Fix For: Backlog


It would be useful to be able to access the current overall memory usage of the 
qdrouterd process via management.

This proposal would include
 * add a in-use memory gauge to the org.apache.qpid.dispatch.router entity
 * add a max available memory gauge to the same entity (optional)
 * integrate these values into the qdstat -m output

These gauges should report back "0" if the platform does not provide the 
ability to access these metrics in process.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Commented] (DISPATCH-1518) Add ability to turn on router trace logging for a specific connection

2020-02-11 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on DISPATCH-1518:
--

kgiusti commented on pull request #676: DISPATCH-1518: Added ability to turn on 
protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377677601
 
 

 ##
 File path: src/router_core/agent_connection.c
 ##
 @@ -563,47 +568,103 @@ void qdra_connection_update_CT(qdr_core_t  *core,
 // Find the connection that the user connected on. This connection 
must have the correct policy rights which
 // will allow the user on this connection to terminate some other 
connection.
 qdr_connection_t *user_conn = _find_conn_CT(core, query->in_conn);
+qd_parsed_field_t *trace_field   = qd_parse_value_by_key(in_body, 
qdr_connection_columns[QDR_CONNECTION_ENABLE_PROTOCOL_TRACE]);
+bool enable_protocol_trace = !!trace_field ? 
qd_parse_as_bool(trace_field) : false;
+
+qdr_connection_t *conn = 0;
+
+bool admin_status_bad_or_forbidden = false;
+
+if (admin_state) {
+
+if (!user_conn) {
+// This is bad. The user connection (that was requesting that 
some
+// other connection be dropped) is gone
+query->status.description = "Parent connection no longer 
exists";
+qdra_connection_set_bad_request(query);
+admin_status_bad_or_forbidden = true;
+}
+else {
+if (!user_conn->policy_allow_admin_status_update) {
+//
+// Policy on the connection that is requesting that some 
other connection be deleted does not allow
+// for the other connection to be deleted.Set the status 
to QD_AMQP_FORBIDDEN and just quit.
+//
+query->status = QD_AMQP_FORBIDDEN;
+query->status.description = "You are not allowed to 
perform this operation.";
+qd_compose_start_map(query->body);
+qd_compose_end_map(query->body);
+admin_status_bad_or_forbidden = true;
+ }
+else if (admin_state) { //admin state and trace are the only 
fields that can be updated via the update management request for type 
connection.
+if (identity) {
+conn = qdr_connection_find_by_identity_CT(core, 
identity);
+qdra_connection_update_set_status(core, query, conn, 
admin_state);
+}
+else {
+qdra_connection_set_bad_request(query);
+admin_status_bad_or_forbidden = true;
+}
+}
+else {
+qdra_connection_set_bad_request(query);
+admin_status_bad_or_forbidden = true;
+}
+}
+}
+
+if (admin_status_bad_or_forbidden) {
+//
+// Enqueue the response and return
+//
+qdr_agent_enqueue_response_CT(core, query);
+return;
+}
 
-if (!user_conn) {
-// This is bad. The user connection (that was requesting that some
-// other connection be dropped) is gone
-query->status.description = "Parent connection no longer exists";
+//
+// The only two fields that can be updated on a connection is the 
enableProtocolTrace flag and the admin state.
+// If both these fields are not there, this is a bad request
+// For example, this qdmanage is a bad request - qdmanage update 
--type=connection identity=1
+//
+if (!trace_field && !admin_state) {
 qdra_connection_set_bad_request(query);
+qdr_agent_enqueue_response_CT(core, query);
+return;
 }
 
-else {
-if (!user_conn->policy_allow_admin_status_update) {
+if (!conn) {
+if (identity) {
 
 Review comment:
   again, already checked above.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add ability to turn on router trace logging for a specific connection 
> --
>
> Key: DISPATCH-1518
> URL: https://issues.apache.org/jira/browse/DISPATCH-1518
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions

[jira] [Commented] (DISPATCH-1518) Add ability to turn on router trace logging for a specific connection

2020-02-11 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on DISPATCH-1518:
--

kgiusti commented on pull request #676: DISPATCH-1518: Added ability to turn on 
protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377654544
 
 

 ##
 File path: python/qpid_dispatch/management/client.py
 ##
 @@ -76,6 +76,16 @@ def delete(self):
 class Node(object):
 """Client proxy for an AMQP management node"""
 
+def clean_attrs(self, attrs):
+BOOL_VALUES = {"yes": 1, "true": 1, "on": 1, "no": 0, "false": 0,
+   "off": 0}
+if isinstance(attrs, dict):
+for key in attrs.keys():
+if attrs[key] in BOOL_VALUES.keys():
+attrs[key] = bool(BOOL_VALUES[attrs[key]])
 
 Review comment:
   Instead of putting 1 or 0 as the values for BOOL_VALUES, why not use the 
python bools True and False?  Then you don't need to cast to bool()
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add ability to turn on router trace logging for a specific connection 
> --
>
> Key: DISPATCH-1518
> URL: https://issues.apache.org/jira/browse/DISPATCH-1518
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.9.0
>Reporter: Ganesh Murthy
>Assignee: Ganesh Murthy
>Priority: Major
> Fix For: 1.11.0
>
>
> It would be nice to be able to turn on tracing per connection, e.g. something 
> like `qdmanage update --type=connection id=897644 tracing=true`
> That way you could benefit from protocol level tracing on connections of 
> interest as and when needed. Perhaps also there could be some way of 
> specifying a policy for connection tracing, e.g. all connections whose 
> container id is 'foo' or who are connecting from 192.666.555.444 or similar.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Commented] (DISPATCH-1518) Add ability to turn on router trace logging for a specific connection

2020-02-11 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on DISPATCH-1518:
--

kgiusti commented on pull request #676: DISPATCH-1518: Added ability to turn on 
protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377676138
 
 

 ##
 File path: src/router_core/agent_connection.c
 ##
 @@ -563,47 +568,103 @@ void qdra_connection_update_CT(qdr_core_t  *core,
 // Find the connection that the user connected on. This connection 
must have the correct policy rights which
 // will allow the user on this connection to terminate some other 
connection.
 qdr_connection_t *user_conn = _find_conn_CT(core, query->in_conn);
+qd_parsed_field_t *trace_field   = qd_parse_value_by_key(in_body, 
qdr_connection_columns[QDR_CONNECTION_ENABLE_PROTOCOL_TRACE]);
+bool enable_protocol_trace = !!trace_field ? 
qd_parse_as_bool(trace_field) : false;
+
+qdr_connection_t *conn = 0;
+
+bool admin_status_bad_or_forbidden = false;
+
+if (admin_state) {
+
+if (!user_conn) {
+// This is bad. The user connection (that was requesting that 
some
+// other connection be dropped) is gone
+query->status.description = "Parent connection no longer 
exists";
+qdra_connection_set_bad_request(query);
+admin_status_bad_or_forbidden = true;
+}
+else {
+if (!user_conn->policy_allow_admin_status_update) {
+//
+// Policy on the connection that is requesting that some 
other connection be deleted does not allow
+// for the other connection to be deleted.Set the status 
to QD_AMQP_FORBIDDEN and just quit.
+//
+query->status = QD_AMQP_FORBIDDEN;
+query->status.description = "You are not allowed to 
perform this operation.";
+qd_compose_start_map(query->body);
+qd_compose_end_map(query->body);
+admin_status_bad_or_forbidden = true;
+ }
+else if (admin_state) { //admin state and trace are the only 
fields that can be updated via the update management request for type 
connection.
 
 Review comment:
   Isn't this always true since if (admin_state) is checked above on line 578?
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add ability to turn on router trace logging for a specific connection 
> --
>
> Key: DISPATCH-1518
> URL: https://issues.apache.org/jira/browse/DISPATCH-1518
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.9.0
>Reporter: Ganesh Murthy
>Assignee: Ganesh Murthy
>Priority: Major
> Fix For: 1.11.0
>
>
> It would be nice to be able to turn on tracing per connection, e.g. something 
> like `qdmanage update --type=connection id=897644 tracing=true`
> That way you could benefit from protocol level tracing on connections of 
> interest as and when needed. Perhaps also there could be some way of 
> specifying a policy for connection tracing, e.g. all connections whose 
> container id is 'foo' or who are connecting from 192.666.555.444 or similar.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Commented] (DISPATCH-1518) Add ability to turn on router trace logging for a specific connection

2020-02-11 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on DISPATCH-1518:
--

kgiusti commented on pull request #676: DISPATCH-1518: Added ability to turn on 
protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377667238
 
 

 ##
 File path: tests/system_tests_log_level_update.py
 ##
 @@ -120,6 +123,189 @@ def test_turn_on_protocol_trace(self):
 self.assertTrue(num_attaches == 0)
 
 
+class EnableConnectionLevelInterRouterTraceTest(TestCase):
+
+inter_router_port = None
+
+@classmethod
+def setUpClass(cls):
+"""Start a router and a messenger"""
 
 Review comment:
   Stale comment?
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add ability to turn on router trace logging for a specific connection 
> --
>
> Key: DISPATCH-1518
> URL: https://issues.apache.org/jira/browse/DISPATCH-1518
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.9.0
>Reporter: Ganesh Murthy
>Assignee: Ganesh Murthy
>Priority: Major
> Fix For: 1.11.0
>
>
> It would be nice to be able to turn on tracing per connection, e.g. something 
> like `qdmanage update --type=connection id=897644 tracing=true`
> That way you could benefit from protocol level tracing on connections of 
> interest as and when needed. Perhaps also there could be some way of 
> specifying a policy for connection tracing, e.g. all connections whose 
> container id is 'foo' or who are connecting from 192.666.555.444 or similar.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Commented] (DISPATCH-1518) Add ability to turn on router trace logging for a specific connection

2020-02-11 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on DISPATCH-1518:
--

kgiusti commented on pull request #676: DISPATCH-1518: Added ability to turn on 
protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377662447
 
 

 ##
 File path: src/router_core/router_core_private.h
 ##
 @@ -681,6 +684,7 @@ struct qdr_connection_t {
 boolclosed; // This bit is used in the case where 
a client is trying to force close this connection.
 uint32_tconn_uptime; // Timestamp which can be used to 
calculate the number of seconds this connection has been up and running.
 uint32_tlast_delivery_time; // Timestamp which can be 
used to calculate the number of seconds since the last delivery arrived on this 
connection.
+boolenable_protocol_trace; // Has trace level 
logging been turned on for this connecvtion.
 
 Review comment:
   "connecvtion"?
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add ability to turn on router trace logging for a specific connection 
> --
>
> Key: DISPATCH-1518
> URL: https://issues.apache.org/jira/browse/DISPATCH-1518
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.9.0
>Reporter: Ganesh Murthy
>Assignee: Ganesh Murthy
>Priority: Major
> Fix For: 1.11.0
>
>
> It would be nice to be able to turn on tracing per connection, e.g. something 
> like `qdmanage update --type=connection id=897644 tracing=true`
> That way you could benefit from protocol level tracing on connections of 
> interest as and when needed. Perhaps also there could be some way of 
> specifying a policy for connection tracing, e.g. all connections whose 
> container id is 'foo' or who are connecting from 192.666.555.444 or similar.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Commented] (DISPATCH-1518) Add ability to turn on router trace logging for a specific connection

2020-02-11 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on DISPATCH-1518:
--

kgiusti commented on pull request #676: DISPATCH-1518: Added ability to turn on 
protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377676750
 
 

 ##
 File path: src/router_core/agent_connection.c
 ##
 @@ -563,47 +568,103 @@ void qdra_connection_update_CT(qdr_core_t  *core,
 // Find the connection that the user connected on. This connection 
must have the correct policy rights which
 // will allow the user on this connection to terminate some other 
connection.
 qdr_connection_t *user_conn = _find_conn_CT(core, query->in_conn);
+qd_parsed_field_t *trace_field   = qd_parse_value_by_key(in_body, 
qdr_connection_columns[QDR_CONNECTION_ENABLE_PROTOCOL_TRACE]);
+bool enable_protocol_trace = !!trace_field ? 
qd_parse_as_bool(trace_field) : false;
+
+qdr_connection_t *conn = 0;
+
+bool admin_status_bad_or_forbidden = false;
+
+if (admin_state) {
+
+if (!user_conn) {
+// This is bad. The user connection (that was requesting that 
some
+// other connection be dropped) is gone
+query->status.description = "Parent connection no longer 
exists";
+qdra_connection_set_bad_request(query);
+admin_status_bad_or_forbidden = true;
+}
+else {
+if (!user_conn->policy_allow_admin_status_update) {
+//
+// Policy on the connection that is requesting that some 
other connection be deleted does not allow
+// for the other connection to be deleted.Set the status 
to QD_AMQP_FORBIDDEN and just quit.
+//
+query->status = QD_AMQP_FORBIDDEN;
+query->status.description = "You are not allowed to 
perform this operation.";
+qd_compose_start_map(query->body);
+qd_compose_end_map(query->body);
+admin_status_bad_or_forbidden = true;
+ }
+else if (admin_state) { //admin state and trace are the only 
fields that can be updated via the update management request for type 
connection.
+if (identity) {
+conn = qdr_connection_find_by_identity_CT(core, 
identity);
 
 Review comment:
   Same here - identity was checked above in line 562
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add ability to turn on router trace logging for a specific connection 
> --
>
> Key: DISPATCH-1518
> URL: https://issues.apache.org/jira/browse/DISPATCH-1518
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.9.0
>Reporter: Ganesh Murthy
>Assignee: Ganesh Murthy
>Priority: Major
> Fix For: 1.11.0
>
>
> It would be nice to be able to turn on tracing per connection, e.g. something 
> like `qdmanage update --type=connection id=897644 tracing=true`
> That way you could benefit from protocol level tracing on connections of 
> interest as and when needed. Perhaps also there could be some way of 
> specifying a policy for connection tracing, e.g. all connections whose 
> container id is 'foo' or who are connecting from 192.666.555.444 or similar.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Commented] (DISPATCH-1518) Add ability to turn on router trace logging for a specific connection

2020-02-11 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on DISPATCH-1518:
--

kgiusti commented on pull request #676: DISPATCH-1518: Added ability to turn on 
protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377677295
 
 

 ##
 File path: src/router_core/agent_connection.c
 ##
 @@ -563,47 +568,103 @@ void qdra_connection_update_CT(qdr_core_t  *core,
 // Find the connection that the user connected on. This connection 
must have the correct policy rights which
 // will allow the user on this connection to terminate some other 
connection.
 qdr_connection_t *user_conn = _find_conn_CT(core, query->in_conn);
+qd_parsed_field_t *trace_field   = qd_parse_value_by_key(in_body, 
qdr_connection_columns[QDR_CONNECTION_ENABLE_PROTOCOL_TRACE]);
+bool enable_protocol_trace = !!trace_field ? 
qd_parse_as_bool(trace_field) : false;
+
+qdr_connection_t *conn = 0;
+
+bool admin_status_bad_or_forbidden = false;
+
+if (admin_state) {
+
+if (!user_conn) {
+// This is bad. The user connection (that was requesting that 
some
+// other connection be dropped) is gone
+query->status.description = "Parent connection no longer 
exists";
+qdra_connection_set_bad_request(query);
+admin_status_bad_or_forbidden = true;
+}
+else {
+if (!user_conn->policy_allow_admin_status_update) {
+//
+// Policy on the connection that is requesting that some 
other connection be deleted does not allow
+// for the other connection to be deleted.Set the status 
to QD_AMQP_FORBIDDEN and just quit.
+//
+query->status = QD_AMQP_FORBIDDEN;
+query->status.description = "You are not allowed to 
perform this operation.";
+qd_compose_start_map(query->body);
+qd_compose_end_map(query->body);
+admin_status_bad_or_forbidden = true;
+ }
+else if (admin_state) { //admin state and trace are the only 
fields that can be updated via the update management request for type 
connection.
+if (identity) {
+conn = qdr_connection_find_by_identity_CT(core, 
identity);
+qdra_connection_update_set_status(core, query, conn, 
admin_state);
+}
+else {
+qdra_connection_set_bad_request(query);
+admin_status_bad_or_forbidden = true;
+}
+}
+else {
+qdra_connection_set_bad_request(query);
+admin_status_bad_or_forbidden = true;
+}
+}
+}
+
+if (admin_status_bad_or_forbidden) {
+//
+// Enqueue the response and return
+//
+qdr_agent_enqueue_response_CT(core, query);
+return;
+}
 
-if (!user_conn) {
-// This is bad. The user connection (that was requesting that some
-// other connection be dropped) is gone
-query->status.description = "Parent connection no longer exists";
+//
+// The only two fields that can be updated on a connection is the 
enableProtocolTrace flag and the admin state.
+// If both these fields are not there, this is a bad request
+// For example, this qdmanage is a bad request - qdmanage update 
--type=connection identity=1
+//
+if (!trace_field && !admin_state) {
 
 Review comment:
   why not check this first?  You've already checked admin_state above so this 
really is confusing.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add ability to turn on router trace logging for a specific connection 
> --
>
> Key: DISPATCH-1518
> URL: https://issues.apache.org/jira/browse/DISPATCH-1518
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.9.0
>Reporter: Ganesh Murthy
>Assignee: Ganesh Murthy
>Priority: Major
> Fix For: 1.11.0
>
>
> It would be nice to be able to turn on tracing per connection

[jira] [Commented] (DISPATCH-1518) Add ability to turn on router trace logging for a specific connection

2020-02-11 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on DISPATCH-1518:
--

kgiusti commented on pull request #676: DISPATCH-1518: Added ability to turn on 
protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377663839
 
 

 ##
 File path: tests/system_tests_log_level_update.py
 ##
 @@ -120,6 +123,189 @@ def test_turn_on_protocol_trace(self):
 self.assertTrue(num_attaches == 0)
 
 
+class EnableConnectionLevelInterRouterTraceTest(TestCase):
+
+inter_router_port = None
+
+@classmethod
+def setUpClass(cls):
+"""Start a router and a messenger"""
+super(EnableConnectionLevelInterRouterTraceTest, cls).setUpClass()
+
+def router(name, connection):
+
+config = [
+# Use the deprecated attributes helloInterval, raInterval, 
raIntervalFlux, remoteLsMaxAge
 
 Review comment:
   Huh?  This comment seems like a cut&paste artifact.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add ability to turn on router trace logging for a specific connection 
> --
>
> Key: DISPATCH-1518
> URL: https://issues.apache.org/jira/browse/DISPATCH-1518
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.9.0
>Reporter: Ganesh Murthy
>Assignee: Ganesh Murthy
>Priority: Major
> Fix For: 1.11.0
>
>
> It would be nice to be able to turn on tracing per connection, e.g. something 
> like `qdmanage update --type=connection id=897644 tracing=true`
> That way you could benefit from protocol level tracing on connections of 
> interest as and when needed. Perhaps also there could be some way of 
> specifying a policy for connection tracing, e.g. all connections whose 
> container id is 'foo' or who are connecting from 192.666.555.444 or similar.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #676: DISPATCH-1518: Added ability to turn on protocol frame trace logging …

2020-02-11 Thread GitBox
kgiusti commented on a change in pull request #676: DISPATCH-1518: Added 
ability to turn on protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377676750
 
 

 ##
 File path: src/router_core/agent_connection.c
 ##
 @@ -563,47 +568,103 @@ void qdra_connection_update_CT(qdr_core_t  *core,
 // Find the connection that the user connected on. This connection 
must have the correct policy rights which
 // will allow the user on this connection to terminate some other 
connection.
 qdr_connection_t *user_conn = _find_conn_CT(core, query->in_conn);
+qd_parsed_field_t *trace_field   = qd_parse_value_by_key(in_body, 
qdr_connection_columns[QDR_CONNECTION_ENABLE_PROTOCOL_TRACE]);
+bool enable_protocol_trace = !!trace_field ? 
qd_parse_as_bool(trace_field) : false;
+
+qdr_connection_t *conn = 0;
+
+bool admin_status_bad_or_forbidden = false;
+
+if (admin_state) {
+
+if (!user_conn) {
+// This is bad. The user connection (that was requesting that 
some
+// other connection be dropped) is gone
+query->status.description = "Parent connection no longer 
exists";
+qdra_connection_set_bad_request(query);
+admin_status_bad_or_forbidden = true;
+}
+else {
+if (!user_conn->policy_allow_admin_status_update) {
+//
+// Policy on the connection that is requesting that some 
other connection be deleted does not allow
+// for the other connection to be deleted.Set the status 
to QD_AMQP_FORBIDDEN and just quit.
+//
+query->status = QD_AMQP_FORBIDDEN;
+query->status.description = "You are not allowed to 
perform this operation.";
+qd_compose_start_map(query->body);
+qd_compose_end_map(query->body);
+admin_status_bad_or_forbidden = true;
+ }
+else if (admin_state) { //admin state and trace are the only 
fields that can be updated via the update management request for type 
connection.
+if (identity) {
+conn = qdr_connection_find_by_identity_CT(core, 
identity);
 
 Review comment:
   Same here - identity was checked above in line 562


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #676: DISPATCH-1518: Added ability to turn on protocol frame trace logging …

2020-02-11 Thread GitBox
kgiusti commented on a change in pull request #676: DISPATCH-1518: Added 
ability to turn on protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377676138
 
 

 ##
 File path: src/router_core/agent_connection.c
 ##
 @@ -563,47 +568,103 @@ void qdra_connection_update_CT(qdr_core_t  *core,
 // Find the connection that the user connected on. This connection 
must have the correct policy rights which
 // will allow the user on this connection to terminate some other 
connection.
 qdr_connection_t *user_conn = _find_conn_CT(core, query->in_conn);
+qd_parsed_field_t *trace_field   = qd_parse_value_by_key(in_body, 
qdr_connection_columns[QDR_CONNECTION_ENABLE_PROTOCOL_TRACE]);
+bool enable_protocol_trace = !!trace_field ? 
qd_parse_as_bool(trace_field) : false;
+
+qdr_connection_t *conn = 0;
+
+bool admin_status_bad_or_forbidden = false;
+
+if (admin_state) {
+
+if (!user_conn) {
+// This is bad. The user connection (that was requesting that 
some
+// other connection be dropped) is gone
+query->status.description = "Parent connection no longer 
exists";
+qdra_connection_set_bad_request(query);
+admin_status_bad_or_forbidden = true;
+}
+else {
+if (!user_conn->policy_allow_admin_status_update) {
+//
+// Policy on the connection that is requesting that some 
other connection be deleted does not allow
+// for the other connection to be deleted.Set the status 
to QD_AMQP_FORBIDDEN and just quit.
+//
+query->status = QD_AMQP_FORBIDDEN;
+query->status.description = "You are not allowed to 
perform this operation.";
+qd_compose_start_map(query->body);
+qd_compose_end_map(query->body);
+admin_status_bad_or_forbidden = true;
+ }
+else if (admin_state) { //admin state and trace are the only 
fields that can be updated via the update management request for type 
connection.
 
 Review comment:
   Isn't this always true since if (admin_state) is checked above on line 578?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #676: DISPATCH-1518: Added ability to turn on protocol frame trace logging …

2020-02-11 Thread GitBox
kgiusti commented on a change in pull request #676: DISPATCH-1518: Added 
ability to turn on protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377677295
 
 

 ##
 File path: src/router_core/agent_connection.c
 ##
 @@ -563,47 +568,103 @@ void qdra_connection_update_CT(qdr_core_t  *core,
 // Find the connection that the user connected on. This connection 
must have the correct policy rights which
 // will allow the user on this connection to terminate some other 
connection.
 qdr_connection_t *user_conn = _find_conn_CT(core, query->in_conn);
+qd_parsed_field_t *trace_field   = qd_parse_value_by_key(in_body, 
qdr_connection_columns[QDR_CONNECTION_ENABLE_PROTOCOL_TRACE]);
+bool enable_protocol_trace = !!trace_field ? 
qd_parse_as_bool(trace_field) : false;
+
+qdr_connection_t *conn = 0;
+
+bool admin_status_bad_or_forbidden = false;
+
+if (admin_state) {
+
+if (!user_conn) {
+// This is bad. The user connection (that was requesting that 
some
+// other connection be dropped) is gone
+query->status.description = "Parent connection no longer 
exists";
+qdra_connection_set_bad_request(query);
+admin_status_bad_or_forbidden = true;
+}
+else {
+if (!user_conn->policy_allow_admin_status_update) {
+//
+// Policy on the connection that is requesting that some 
other connection be deleted does not allow
+// for the other connection to be deleted.Set the status 
to QD_AMQP_FORBIDDEN and just quit.
+//
+query->status = QD_AMQP_FORBIDDEN;
+query->status.description = "You are not allowed to 
perform this operation.";
+qd_compose_start_map(query->body);
+qd_compose_end_map(query->body);
+admin_status_bad_or_forbidden = true;
+ }
+else if (admin_state) { //admin state and trace are the only 
fields that can be updated via the update management request for type 
connection.
+if (identity) {
+conn = qdr_connection_find_by_identity_CT(core, 
identity);
+qdra_connection_update_set_status(core, query, conn, 
admin_state);
+}
+else {
+qdra_connection_set_bad_request(query);
+admin_status_bad_or_forbidden = true;
+}
+}
+else {
+qdra_connection_set_bad_request(query);
+admin_status_bad_or_forbidden = true;
+}
+}
+}
+
+if (admin_status_bad_or_forbidden) {
+//
+// Enqueue the response and return
+//
+qdr_agent_enqueue_response_CT(core, query);
+return;
+}
 
-if (!user_conn) {
-// This is bad. The user connection (that was requesting that some
-// other connection be dropped) is gone
-query->status.description = "Parent connection no longer exists";
+//
+// The only two fields that can be updated on a connection is the 
enableProtocolTrace flag and the admin state.
+// If both these fields are not there, this is a bad request
+// For example, this qdmanage is a bad request - qdmanage update 
--type=connection identity=1
+//
+if (!trace_field && !admin_state) {
 
 Review comment:
   why not check this first?  You've already checked admin_state above so this 
really is confusing.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #676: DISPATCH-1518: Added ability to turn on protocol frame trace logging …

2020-02-11 Thread GitBox
kgiusti commented on a change in pull request #676: DISPATCH-1518: Added 
ability to turn on protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377667238
 
 

 ##
 File path: tests/system_tests_log_level_update.py
 ##
 @@ -120,6 +123,189 @@ def test_turn_on_protocol_trace(self):
 self.assertTrue(num_attaches == 0)
 
 
+class EnableConnectionLevelInterRouterTraceTest(TestCase):
+
+inter_router_port = None
+
+@classmethod
+def setUpClass(cls):
+"""Start a router and a messenger"""
 
 Review comment:
   Stale comment?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[jira] [Commented] (DISPATCH-1518) Add ability to turn on router trace logging for a specific connection

2020-02-11 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on DISPATCH-1518:
--

kgiusti commented on pull request #676: DISPATCH-1518: Added ability to turn on 
protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377660322
 
 

 ##
 File path: python/qpid_dispatch/management/qdrouter.json
 ##
 @@ -1750,6 +1750,12 @@
 "description": "Indicates whether the connection content 
is encrypted.",
 "type": "boolean"
 },
+"enableProtocolTrace": {
+"description": "Indicates whether protocol level amqp 
frame trace logging is turned on or off for this connection.",
+"type": "boolean",
+"create": false,
+"default": false
+},
 
 Review comment:
   Should this include "update": true?
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add ability to turn on router trace logging for a specific connection 
> --
>
> Key: DISPATCH-1518
> URL: https://issues.apache.org/jira/browse/DISPATCH-1518
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.9.0
>Reporter: Ganesh Murthy
>Assignee: Ganesh Murthy
>Priority: Major
> Fix For: 1.11.0
>
>
> It would be nice to be able to turn on tracing per connection, e.g. something 
> like `qdmanage update --type=connection id=897644 tracing=true`
> That way you could benefit from protocol level tracing on connections of 
> interest as and when needed. Perhaps also there could be some way of 
> specifying a policy for connection tracing, e.g. all connections whose 
> container id is 'foo' or who are connecting from 192.666.555.444 or similar.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #676: DISPATCH-1518: Added ability to turn on protocol frame trace logging …

2020-02-11 Thread GitBox
kgiusti commented on a change in pull request #676: DISPATCH-1518: Added 
ability to turn on protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377662447
 
 

 ##
 File path: src/router_core/router_core_private.h
 ##
 @@ -681,6 +684,7 @@ struct qdr_connection_t {
 boolclosed; // This bit is used in the case where 
a client is trying to force close this connection.
 uint32_tconn_uptime; // Timestamp which can be used to 
calculate the number of seconds this connection has been up and running.
 uint32_tlast_delivery_time; // Timestamp which can be 
used to calculate the number of seconds since the last delivery arrived on this 
connection.
+boolenable_protocol_trace; // Has trace level 
logging been turned on for this connecvtion.
 
 Review comment:
   "connecvtion"?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[jira] [Commented] (DISPATCH-1518) Add ability to turn on router trace logging for a specific connection

2020-02-11 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on DISPATCH-1518:
--

kgiusti commented on pull request #676: DISPATCH-1518: Added ability to turn on 
protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377655039
 
 

 ##
 File path: python/qpid_dispatch/management/client.py
 ##
 @@ -76,6 +76,16 @@ def delete(self):
 class Node(object):
 """Client proxy for an AMQP management node"""
 
+def clean_attrs(self, attrs):
+BOOL_VALUES = {"yes": 1, "true": 1, "on": 1, "no": 0, "false": 0,
 
 Review comment:
   What about case?  Is 'Yes' true or only 'yes'?
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add ability to turn on router trace logging for a specific connection 
> --
>
> Key: DISPATCH-1518
> URL: https://issues.apache.org/jira/browse/DISPATCH-1518
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container
>Affects Versions: 1.9.0
>Reporter: Ganesh Murthy
>Assignee: Ganesh Murthy
>Priority: Major
> Fix For: 1.11.0
>
>
> It would be nice to be able to turn on tracing per connection, e.g. something 
> like `qdmanage update --type=connection id=897644 tracing=true`
> That way you could benefit from protocol level tracing on connections of 
> interest as and when needed. Perhaps also there could be some way of 
> specifying a policy for connection tracing, e.g. all connections whose 
> container id is 'foo' or who are connecting from 192.666.555.444 or similar.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #676: DISPATCH-1518: Added ability to turn on protocol frame trace logging …

2020-02-11 Thread GitBox
kgiusti commented on a change in pull request #676: DISPATCH-1518: Added 
ability to turn on protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377654544
 
 

 ##
 File path: python/qpid_dispatch/management/client.py
 ##
 @@ -76,6 +76,16 @@ def delete(self):
 class Node(object):
 """Client proxy for an AMQP management node"""
 
+def clean_attrs(self, attrs):
+BOOL_VALUES = {"yes": 1, "true": 1, "on": 1, "no": 0, "false": 0,
+   "off": 0}
+if isinstance(attrs, dict):
+for key in attrs.keys():
+if attrs[key] in BOOL_VALUES.keys():
+attrs[key] = bool(BOOL_VALUES[attrs[key]])
 
 Review comment:
   Instead of putting 1 or 0 as the values for BOOL_VALUES, why not use the 
python bools True and False?  Then you don't need to cast to bool()


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #676: DISPATCH-1518: Added ability to turn on protocol frame trace logging …

2020-02-11 Thread GitBox
kgiusti commented on a change in pull request #676: DISPATCH-1518: Added 
ability to turn on protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377677601
 
 

 ##
 File path: src/router_core/agent_connection.c
 ##
 @@ -563,47 +568,103 @@ void qdra_connection_update_CT(qdr_core_t  *core,
 // Find the connection that the user connected on. This connection 
must have the correct policy rights which
 // will allow the user on this connection to terminate some other 
connection.
 qdr_connection_t *user_conn = _find_conn_CT(core, query->in_conn);
+qd_parsed_field_t *trace_field   = qd_parse_value_by_key(in_body, 
qdr_connection_columns[QDR_CONNECTION_ENABLE_PROTOCOL_TRACE]);
+bool enable_protocol_trace = !!trace_field ? 
qd_parse_as_bool(trace_field) : false;
+
+qdr_connection_t *conn = 0;
+
+bool admin_status_bad_or_forbidden = false;
+
+if (admin_state) {
+
+if (!user_conn) {
+// This is bad. The user connection (that was requesting that 
some
+// other connection be dropped) is gone
+query->status.description = "Parent connection no longer 
exists";
+qdra_connection_set_bad_request(query);
+admin_status_bad_or_forbidden = true;
+}
+else {
+if (!user_conn->policy_allow_admin_status_update) {
+//
+// Policy on the connection that is requesting that some 
other connection be deleted does not allow
+// for the other connection to be deleted.Set the status 
to QD_AMQP_FORBIDDEN and just quit.
+//
+query->status = QD_AMQP_FORBIDDEN;
+query->status.description = "You are not allowed to 
perform this operation.";
+qd_compose_start_map(query->body);
+qd_compose_end_map(query->body);
+admin_status_bad_or_forbidden = true;
+ }
+else if (admin_state) { //admin state and trace are the only 
fields that can be updated via the update management request for type 
connection.
+if (identity) {
+conn = qdr_connection_find_by_identity_CT(core, 
identity);
+qdra_connection_update_set_status(core, query, conn, 
admin_state);
+}
+else {
+qdra_connection_set_bad_request(query);
+admin_status_bad_or_forbidden = true;
+}
+}
+else {
+qdra_connection_set_bad_request(query);
+admin_status_bad_or_forbidden = true;
+}
+}
+}
+
+if (admin_status_bad_or_forbidden) {
+//
+// Enqueue the response and return
+//
+qdr_agent_enqueue_response_CT(core, query);
+return;
+}
 
-if (!user_conn) {
-// This is bad. The user connection (that was requesting that some
-// other connection be dropped) is gone
-query->status.description = "Parent connection no longer exists";
+//
+// The only two fields that can be updated on a connection is the 
enableProtocolTrace flag and the admin state.
+// If both these fields are not there, this is a bad request
+// For example, this qdmanage is a bad request - qdmanage update 
--type=connection identity=1
+//
+if (!trace_field && !admin_state) {
 qdra_connection_set_bad_request(query);
+qdr_agent_enqueue_response_CT(core, query);
+return;
 }
 
-else {
-if (!user_conn->policy_allow_admin_status_update) {
+if (!conn) {
+if (identity) {
 
 Review comment:
   again, already checked above.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #676: DISPATCH-1518: Added ability to turn on protocol frame trace logging …

2020-02-11 Thread GitBox
kgiusti commented on a change in pull request #676: DISPATCH-1518: Added 
ability to turn on protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377663839
 
 

 ##
 File path: tests/system_tests_log_level_update.py
 ##
 @@ -120,6 +123,189 @@ def test_turn_on_protocol_trace(self):
 self.assertTrue(num_attaches == 0)
 
 
+class EnableConnectionLevelInterRouterTraceTest(TestCase):
+
+inter_router_port = None
+
+@classmethod
+def setUpClass(cls):
+"""Start a router and a messenger"""
+super(EnableConnectionLevelInterRouterTraceTest, cls).setUpClass()
+
+def router(name, connection):
+
+config = [
+# Use the deprecated attributes helloInterval, raInterval, 
raIntervalFlux, remoteLsMaxAge
 
 Review comment:
   Huh?  This comment seems like a cut&paste artifact.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #676: DISPATCH-1518: Added ability to turn on protocol frame trace logging …

2020-02-11 Thread GitBox
kgiusti commented on a change in pull request #676: DISPATCH-1518: Added 
ability to turn on protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377660322
 
 

 ##
 File path: python/qpid_dispatch/management/qdrouter.json
 ##
 @@ -1750,6 +1750,12 @@
 "description": "Indicates whether the connection content 
is encrypted.",
 "type": "boolean"
 },
+"enableProtocolTrace": {
+"description": "Indicates whether protocol level amqp 
frame trace logging is turned on or off for this connection.",
+"type": "boolean",
+"create": false,
+"default": false
+},
 
 Review comment:
   Should this include "update": true?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #676: DISPATCH-1518: Added ability to turn on protocol frame trace logging …

2020-02-11 Thread GitBox
kgiusti commented on a change in pull request #676: DISPATCH-1518: Added 
ability to turn on protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377655039
 
 

 ##
 File path: python/qpid_dispatch/management/client.py
 ##
 @@ -76,6 +76,16 @@ def delete(self):
 class Node(object):
 """Client proxy for an AMQP management node"""
 
+def clean_attrs(self, attrs):
+BOOL_VALUES = {"yes": 1, "true": 1, "on": 1, "no": 0, "false": 0,
 
 Review comment:
   What about case?  Is 'Yes' true or only 'yes'?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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