hashserv: Ensure we don't accumulate sockets in TIME_WAIT state
PATCH 1/2 hashserv: Ensure we don't accumulate sockets in TIME_WAIT state
This can cause a huge backlog of closing sockets on the server and in our case we don't really want/need the protection TCP is trying to give us so work around it.
Signed-off-by Richard Purdie <[email protected]>
--- lib/hashserv/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+)
lib/hashserv/__init__.py +6 -0
@@ -14,6 +14,8 @@ import socketserver import queue import threading import signal +import socket +import struct from datetime import datetime logger = logging.getLogger('hashserv')
@@ -157,6 +159,10 @@ class ThreadedHTTPServer(HTTPServer): self.server_close() os._exit(0) + def server_bind(self): + HTTPServer.server_bind(self) + self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack('ii', 1, 0)) + def process_request_thread(self): while not self.quit: try:
Signature · 1 line
2.20.1
PATCH 2/2 runqueue: Ensure target_tids is filtered
bitbake <target> --runonly=fetch
failed as the target_tids list included entries which were no longer targeted task ids. Fix this.
Signed-off-by Richard Purdie <[email protected]>
--- lib/bb/runqueue.py | 1 + 1 file changed, 1 insertion(+)
lib/bb/runqueue.py +1 -0
@@ -1736,6 +1736,7 @@ class RunQueueExecute: # We can't skip specified target tasks which aren't setscene tasks self.cantskip = set(self.rqdata.target_tids) self.cantskip.difference_update(self.rqdata.runq_setscene_tids) + self.cantskip.intersection_update(self.rqdata.runtaskentries) schedulers = self.get_schedulers() for scheduler in schedulers:
Signature · 1 line
2.20.1