Skip to content

Commit fee9440

Browse files
committed
[Grid] Hub status should only count reachable proxies. Fixes #6494
1 parent 04deefa commit fee9440

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

java/server/src/org/openqa/grid/web/servlet/HubW3CStatusServlet.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,16 @@ public HubW3CStatusServlet(GridRegistry registry) {
5454
@Override
5555
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
5656
throws IOException {
57-
List<RemoteProxy> allProxies = registry.getAllProxies().getSorted();
57+
List<RemoteProxy> allProxies = registry.getAllProxies().getSorted()
58+
.parallelStream().filter(remoteProxy -> {
59+
// Only counting proxies that reply at their status endpoint
60+
try {
61+
remoteProxy.getProxyStatus();
62+
return true;
63+
} catch (Exception e) {
64+
return false;
65+
}
66+
}).collect(Collectors.toList());
5867
List<RemoteProxy> busyProxies = allProxies.parallelStream()
5968
.filter(proxy -> proxy.getMaxNumberOfConcurrentTestSessions() - proxy.getTotalUsed() <= 0)
6069
.collect(Collectors.toList());

0 commit comments

Comments
 (0)