From d199e76cea45bb006eb15748da3fcb24754b21f0 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Mon, 28 Dec 2015 12:56:11 +0100 Subject: [PATCH] revert TCP__FASTOPEN change on OSX socket.TCP_FASTOPEN is set but make the server enter in a loop while trying to set the options which makes gunicorn unusable. For now remove TCP_FASTOPEN option until we find a solution --- gunicorn/config.py | 34 ---------------------------------- gunicorn/sock.py | 5 ----- 2 files changed, 39 deletions(-) diff --git a/gunicorn/config.py b/gunicorn/config.py index ab6b276f..64c12d07 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -1705,37 +1705,3 @@ if sys.version_info >= (2, 7): desc = """\ Ciphers to use (see stdlib ssl module's) """ - - -class AllowTCPFastOpen(Setting): - name = "allow_tcp_fast_open" - section = "Server Socket" - cli = ["--allow-tcp-fast-open"] - validator = validate_bool - default = False - action = "store_true" - desc = """\ - Whether the server will allow the TCP Fast Open. - - Available on Linux >= 3.7.1, Python>= 3.4 - - More info: http://research.google.com/pubs/pub37517.html - - .. versionadded:: 19.5 - """ - - -class TCPFastOpenQueue(Setting): - name = "tcp_fast_open_queue" - section = "Server Socket" - cli = ["--tcp-fast-open-queue"] - meta = "INT" - validator = validate_pos_int - type = int - default = 5 - desc = """\ - The size of the TCP Fast Open queue. If the number of connections exceed - this value, the other connections are proceed with a normal 3-way. - - .. versionadded:: 19.5 - """ diff --git a/gunicorn/sock.py b/gunicorn/sock.py index 522b9094..4de97285 100644 --- a/gunicorn/sock.py +++ b/gunicorn/sock.py @@ -75,11 +75,6 @@ class TCPSocket(BaseSocket): def set_options(self, sock, bound=False): sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) - - if hasattr(socket, 'TCP_FASTOPEN') and self.cfg.allow_tcp_fast_open: - sock.setsockopt(socket.SOL_TCP, socket.TCP_FASTOPEN, - self.cfg.tcp_fast_open_queue) - return super(TCPSocket, self).set_options(sock, bound=bound)