mirror of
https://git.yoctoproject.org/poky
synced 2026-03-17 04:39:40 +01:00
bitbake: 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. (Bitbake rev: 7bc79fdf60519231da7c0c7b5b6143ce090ed830) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user