[oe-commits] [bitbake] 04/04: hashserv: Ensure we don't accumulate sockets in TIME_WAIT state

git at git.openembedded.org git at git.openembedded.org
Thu Aug 15 21:55:27 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 8923d1e9479ce8801851efc8b9ecbfc0ebec6426
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Thu Aug 15 22:54:43 2019 +0100

    hashserv: Ensure we don't accumulate sockets in TIME_WAIT state
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/hashserv/__init__.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/hashserv/__init__.py b/lib/hashserv/__init__.py
index 76f5060..7a30f03 100644
--- a/lib/hashserv/__init__.py
+++ b/lib/hashserv/__init__.py
@@ -17,6 +17,7 @@ import signal
 import time
 import math
 import socket
+import struct
 import threading
 from contextlib import contextmanager
 from datetime import datetime
@@ -353,6 +354,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 True:
             try:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list