diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-08-15 22:54:43 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-08-16 10:05:32 +0100 |
commit | 0b38a37e59eebd33d3b42359ed79c5f3e36e01b9 (patch) | |
tree | 267d25e2bde8835cf95cb2cbf9d5936c8ddc8626 /bitbake/lib/hashserv | |
parent | 2cb6a75b5ad54fb4224a41a65a4f2bcc902f5b94 (diff) | |
download | poky-0b38a37e59eebd33d3b42359ed79c5f3e36e01b9.tar.gz |
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>
Diffstat (limited to 'bitbake/lib/hashserv')
-rw-r--r-- | bitbake/lib/hashserv/__init__.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bitbake/lib/hashserv/__init__.py b/bitbake/lib/hashserv/__init__.py index 55966e748a..eb03c32213 100644 --- a/bitbake/lib/hashserv/__init__.py +++ b/bitbake/lib/hashserv/__init__.py | |||
@@ -14,6 +14,8 @@ import socketserver | |||
14 | import queue | 14 | import queue |
15 | import threading | 15 | import threading |
16 | import signal | 16 | import signal |
17 | import socket | ||
18 | import struct | ||
17 | from datetime import datetime | 19 | from datetime import datetime |
18 | 20 | ||
19 | logger = logging.getLogger('hashserv') | 21 | logger = logging.getLogger('hashserv') |
@@ -157,6 +159,10 @@ class ThreadedHTTPServer(HTTPServer): | |||
157 | self.server_close() | 159 | self.server_close() |
158 | os._exit(0) | 160 | os._exit(0) |
159 | 161 | ||
162 | def server_bind(self): | ||
163 | HTTPServer.server_bind(self) | ||
164 | self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack('ii', 1, 0)) | ||
165 | |||
160 | def process_request_thread(self): | 166 | def process_request_thread(self): |
161 | while not self.quit: | 167 | while not self.quit: |
162 | try: | 168 | try: |