Merge lp:~corey.bryant/ubuntu/utopic/python-eventlet/0.13.0-1ubuntu3.1 into lp:ubuntu/utopic/python-eventlet

Proposed by Corey Bryant
Status: Approved
Approved by: James Page
Approved revision: 25
Proposed branch: lp:~corey.bryant/ubuntu/utopic/python-eventlet/0.13.0-1ubuntu3.1
Merge into: lp:ubuntu/utopic/python-eventlet
Diff against target: 115 lines (+95/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/series (+1/-0)
debian/patches/socket-timeout.patch (+87/-0)
To merge this branch: bzr merge lp:~corey.bryant/ubuntu/utopic/python-eventlet/0.13.0-1ubuntu3.1
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+248960@code.launchpad.net
To post a comment you must log in.
25. By Corey Bryant

debian/patches/socket-timeout.patch: Cherry-pick patch to provide
socket_timeout support (LP: #1419117).

Unmerged revisions

25. By Corey Bryant

debian/patches/socket-timeout.patch: Cherry-pick patch to provide
socket_timeout support (LP: #1419117).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-10-08 16:22:45 +0000
3+++ debian/changelog 2015-02-09 14:32:31 +0000
4@@ -1,3 +1,10 @@
5+python-eventlet (0.13.0-1ubuntu3.1) UNRELEASED; urgency=medium
6+
7+ * debian/patches/socket-timeout.patch: Cherry-pick patch to provide
8+ socket_timeout support (LP: #1419117).
9+
10+ -- Corey Bryant <corey.bryant@canonical.com> Fri, 06 Feb 2015 13:42:06 -0500
11+
12 python-eventlet (0.13.0-1ubuntu3) utopic; urgency=medium
13
14 * Fix build failure with python2.7 and PEP 466.
15
16=== modified file 'debian/patches/series'
17--- debian/patches/series 2014-10-08 16:22:45 +0000
18+++ debian/patches/series 2015-02-09 14:32:31 +0000
19@@ -1,3 +1,4 @@
20 skip-failing-tests.patch
21 fix-FTBFS-on-sphinx-build.patch
22 sslwrap.diff
23+socket-timeout.patch
24
25=== added file 'debian/patches/socket-timeout.patch'
26--- debian/patches/socket-timeout.patch 1970-01-01 00:00:00 +0000
27+++ debian/patches/socket-timeout.patch 2015-02-09 14:32:31 +0000
28@@ -0,0 +1,87 @@
29+From 7d4916f01462de09cb58853d9de2e85777c2ad5b Mon Sep 17 00:00:00 2001
30+From: Sergey Shepelev <temotor@gmail.com>
31+Date: Fri, 9 Aug 2013 14:25:10 +0400
32+Subject: [PATCH] wsgi: configurable socket_timeout
33+
34+---
35+ eventlet/wsgi.py | 13 ++++++++++---
36+ tests/wsgi_test.py | 11 +++++++++++
37+ 2 files changed, 21 insertions(+), 3 deletions(-)
38+
39+--- a/eventlet/wsgi.py
40++++ b/eventlet/wsgi.py
41+@@ -535,7 +535,8 @@
42+ log_output=True,
43+ log_format=DEFAULT_LOG_FORMAT,
44+ url_length_limit=MAX_REQUEST_LINE,
45+- debug=True):
46++ debug=True,
47++ socket_timeout=None):
48+
49+ self.outstanding_requests = 0
50+ self.socket = socket
51+@@ -556,6 +557,7 @@
52+ self.log_format = log_format
53+ self.url_length_limit = url_length_limit
54+ self.debug = debug
55++ self.socket_timeout = socket_timeout
56+
57+ def get_environ(self):
58+ d = {
59+@@ -609,7 +611,8 @@
60+ log_output=True,
61+ log_format=DEFAULT_LOG_FORMAT,
62+ url_length_limit=MAX_REQUEST_LINE,
63+- debug=True):
64++ debug=True,
65++ socket_timeout=None):
66+ """ Start up a wsgi server handling requests from the supplied server
67+ socket. This function loops forever. The *sock* object will be closed after server exits,
68+ but the underlying file descriptor will remain open, so if you have a dup() of *sock*,
69+@@ -631,6 +634,7 @@
70+ :param log_format: A python format string that is used as the template to generate log lines. The following values can be formatted into it: client_ip, date_time, request_line, status_code, body_length, wall_seconds. The default is a good example of how to use it.
71+ :param url_length_limit: A maximum allowed length of the request url. If exceeded, 414 error is returned.
72+ :param debug: True if the server should send exception tracebacks to the clients on 500 errors. If False, the server will respond with empty bodies.
73++ :param socket_timeout: Timeout for client connections' socket operations. Default None means wait forever.
74+ """
75+ serv = Server(sock, sock.getsockname(),
76+ site, log,
77+@@ -643,7 +647,9 @@
78+ log_output=log_output,
79+ log_format=log_format,
80+ url_length_limit=url_length_limit,
81+- debug=debug)
82++ debug=debug,
83++ socket_timeout=socket_timeout,
84++ )
85+ if server_event is not None:
86+ server_event.send(serv)
87+ if max_size is None:
88+@@ -669,6 +675,7 @@
89+ while True:
90+ try:
91+ client_socket = sock.accept()
92++ client_socket[0].settimeout(serv.socket_timeout)
93+ if debug:
94+ serv.log.write("(%s) accepted %r\n" % (
95+ serv.pid, client_socket[1]))
96+--- a/tests/wsgi_test.py
97++++ b/tests/wsgi_test.py
98+@@ -1144,6 +1144,17 @@
99+ request_thread.wait()
100+ server_sock.close()
101+
102++ def test_server_socket_timeout(self):
103++ self.spawn_server(socket_timeout=0.1)
104++ sock = eventlet.connect(('localhost', self.port))
105++ sock.send('GET / HTTP/1.1\r\n')
106++ eventlet.sleep(0.1)
107++ try:
108++ read_http(sock)
109++ assert False, 'Expected ConnectionClosed exception'
110++ except ConnectionClosed:
111++ pass
112++
113+
114+ def read_headers(sock):
115+ fd = sock.makefile()

Subscribers

People subscribed via source and target branches

to all changes: