You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2019/05/10 13:02:43 UTC

[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #503: DISPATCH-974 - Added code to qdstat and qdmanage clients to repeatedl…

kgiusti commented on a change in pull request #503: DISPATCH-974 - Added code to qdstat and qdmanage clients to repeatedl…
URL: https://github.com/apache/qpid-dispatch/pull/503#discussion_r282873666
 
 

 ##########
 File path: python/qpid_dispatch/management/client.py
 ##########
 @@ -225,12 +225,61 @@ def query(self, type=None, attribute_names=None, offset=None, count=None):
         @keyword count: A count of the maximum number of results to return.
         @return: A L{QueryResponse}
         """
-        request = self.node_request(
-            {u'attributeNames': attribute_names or []},
-            operation=u'QUERY', entityType=type, offset=offset, count=count)
 
-        response = self.call(request)
-        return Node.QueryResponse(self, response.body[u'attributeNames'], response.body[u'results'])
+        # There is a bug in proton (PROTON-1846) wherein we cannot ask for
+        # too many rows. So, as a safety we are going to ask only for
+        # MAX_ALLOWED_COUNT_PER_REQUEST. Since this is used by both qdstat
+        # and qdmanage, we have determined that the optimal value for
+        # MAX_ALLOWED_COUNT_PER_REQUEST is 700
+        MAX_ALLOWED_COUNT_PER_REQUEST = 700
+
+        response_results = []
+        response_attr_names = []
+        if offset is None:
+            offset = 0
+
+        if count is None:
+            # count has not been specified. For each request the
+            # maximum number of rows we can get without proton
+            # failing is MAX_ALLOWED_COUNT_PER_REQUEST
+            request_count = MAX_ALLOWED_COUNT_PER_REQUEST
+        else:
+            if count > MAX_ALLOWED_COUNT_PER_REQUEST:
 
 Review comment:
   nit: more "pythonic":   count = min(MAX_ALLOWED_COUNT_PER_REQUEST, count)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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