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

2020-02-18 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on DISPATCH-1518:
---

Commit bc085461093511d22a5574a5ce54b41177379b13 in qpid-dispatch's branch 
refs/heads/master from Ganesh Murthy
[ https://gitbox.apache.org/repos/asf?p=qpid-dispatch.git;h=bc08546 ]

DISPATCH-1518: Additional fix to clean_attrs to clean only string type 
attributes


> 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-14 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on DISPATCH-1518:
---

Commit d0b045a13778c41d33ed24af25eb350e8b9a738c in qpid-dispatch's branch 
refs/heads/master from Ganesh Murthy
[ https://gitbox.apache.org/repos/asf?p=qpid-dispatch.git;h=d0b045a ]

DISPATCH-1518: Added ability to turn on protocol frame trace logging for a 
particular connection. This closes #676


> 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-14 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on DISPATCH-1518:
--

asfgit 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
 
 
   
 

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-13 Thread ASF GitHub Bot (Jira)


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

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



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

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


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

ASF GitHub Bot commented on DISPATCH-1518:
--

ganeshmurthy commented on issue #676: DISPATCH-1518: Added ability to turn on 
protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#issuecomment-585214485
 
 
   @kgiusti @ChugR I have added a new commit to this PR which addresses your 
code review comments. Please take a look and 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=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



[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=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



[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=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



[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=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, e.g. something 

[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=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 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



[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=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: 1.9.0
>

[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=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=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=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=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=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=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



[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=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



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

2020-01-31 Thread ASF GitHub Bot (Jira)


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

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
 
 
   …for a particular connection
 

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