Public bug reported: In our site, I have found get_running_builds to be very slow.
I have found that it's because depth=2 is used when calling get_node_info, and it seems to be fixed by the following patch: diff --git a/jenkins/__init__.py b/jenkins/__init__.py index b443756..20cc17c 100755 --- a/jenkins/__init__.py +++ b/jenkins/__init__.py @@ -1411,7 +1411,7 @@ class Jenkins(object): else: node_name = node['name'] try: - info = self.get_node_info(node_name, depth=2) + info = self.get_node_info(node_name, depth=1) except JenkinsException as e: # Jenkins may 500 on depth >0. If the node info comes back # at depth 0 treat it as a node not running any jobs. After we change the depth to 1, I can still get the list of running builds, so depth=2 seems to be a waste. But I may be missing something here, is there a reason why we must use depth=2 instead of depth=1? ** Affects: python-jenkins Importance: Undecided Status: New -- You received this bug notification because you are a member of Python Jenkins Developers, which is subscribed to Python Jenkins. https://bugs.launchpad.net/bugs/1826803 Title: get_running_builds very slow to return results Status in Python Jenkins: New Bug description: In our site, I have found get_running_builds to be very slow. I have found that it's because depth=2 is used when calling get_node_info, and it seems to be fixed by the following patch: diff --git a/jenkins/__init__.py b/jenkins/__init__.py index b443756..20cc17c 100755 --- a/jenkins/__init__.py +++ b/jenkins/__init__.py @@ -1411,7 +1411,7 @@ class Jenkins(object): else: node_name = node['name'] try: - info = self.get_node_info(node_name, depth=2) + info = self.get_node_info(node_name, depth=1) except JenkinsException as e: # Jenkins may 500 on depth >0. If the node info comes back # at depth 0 treat it as a node not running any jobs. After we change the depth to 1, I can still get the list of running builds, so depth=2 seems to be a waste. But I may be missing something here, is there a reason why we must use depth=2 instead of depth=1? To manage notifications about this bug go to: https://bugs.launchpad.net/python-jenkins/+bug/1826803/+subscriptions -- Mailing list: https://launchpad.net/~python-jenkins-developers Post to : python-jenkins-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~python-jenkins-developers More help : https://help.launchpad.net/ListHelp