Giuseppe Lavagetto has submitted this change and it was merged.

Change subject: pooler-loop: ignore unreachable/down pybals
......................................................................


pooler-loop: ignore unreachable/down pybals

Change-Id: I0b8cfb1364717c66f389de7eb2633dd202574526
---
M modules/conftool/files/pooler_loop.rb
1 file changed, 12 insertions(+), 2 deletions(-)

Approvals:
  Giuseppe Lavagetto: Verified; Looks good to me, approved



diff --git a/modules/conftool/files/pooler_loop.rb 
b/modules/conftool/files/pooler_loop.rb
index 5b10c47..f5dedc3 100755
--- a/modules/conftool/files/pooler_loop.rb
+++ b/modules/conftool/files/pooler_loop.rb
@@ -69,8 +69,18 @@
 end
 
 def check_pooled_state(ip, port, pool, host, want_pooled)
-  resp = Net::HTTP.start(ip, port) do |http|
-    http.get "/pools/#{pool}/#{host}"
+  # Manage down or unresponsive pybals
+  http = Net::HTTP.new(ip, port)
+  http.open_timeout = 1
+  http.read_timeout = 2
+
+  begin
+    resp = http.start do |http|
+      http.get "/pools/#{pool}/#{host}"
+    end
+  rescue Timeout::Error
+    # If pybal is down, don't care about it
+    return true
   end
   # ignore 404s
   # rubocop:disable Style/CaseEquality

-- 
To view, visit https://gerrit.wikimedia.org/r/316219
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0b8cfb1364717c66f389de7eb2633dd202574526
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Giuseppe Lavagetto <glavage...@wikimedia.org>
Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to