Yuvipanda has uploaded a new change for review.
https://gerrit.wikimedia.org/r/204012
Change subject: tools: Don't use portgranter anywhere
......................................................................
tools: Don't use portgranter anywhere
Wheeeee :D
So portgrabber too will just attempt to get a port locally
by just trying some until they work. This removes portgranter
dependency. There is still a small race condition, but that
just causes the webserver to fail, and at worst it will
just get restarted by webservicemonitor in 10s. And since
webservicemonitor sends metrics to graphite, we can use that
to figure this out :)
Bug: T93046
Change-Id: I02a9544da69c3334ed018f663186c97dbe80f31a
---
M modules/toollabs/files/portgrabber
1 file changed, 2 insertions(+), 7 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/12/204012/1
diff --git a/modules/toollabs/files/portgrabber
b/modules/toollabs/files/portgrabber
index 61f9267..1cb78b3 100755
--- a/modules/toollabs/files/portgrabber
+++ b/modules/toollabs/files/portgrabber
@@ -18,13 +18,8 @@
# Set tool name.
tool = sys.argv[1]
-# Connect to local portgranter instance and receive a (hopefully)
-# unallocated port number.
-s = socket.socket(socket.AF_UNIX)
-s.connect('/tmp/sock.portgranter')
-f = s.makefile('r+', 0)
-f.write(tool + '\n')
-port = int(f.readline().rstrip())
+# Attempt to get a local unused port
+port = portgrabber.get_open_port()
# Connect to the proxylistener instances on the web proxies and notify
# them where requests for the tool need to be routed to.
--
To view, visit https://gerrit.wikimedia.org/r/204012
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I02a9544da69c3334ed018f663186c97dbe80f31a
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits