Merge lp:~corey.bryant/ubuntu/trusty/python-eventlet/0.13.0-1ubuntu2.1 into lp:ubuntu/trusty/python-eventlet

Proposed by Corey Bryant
Status: Approved
Approved by: Brian Murray
Approved revision: 24
Proposed branch: lp:~corey.bryant/ubuntu/trusty/python-eventlet/0.13.0-1ubuntu2.1
Merge into: lp:ubuntu/trusty/python-eventlet
Diff against target: 114 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/trusty/python-eventlet/0.13.0-1ubuntu2.1
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+250175@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) wrote :

This was already uploaded to trusty.

Unmerged revisions

24. 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-02-23 13:51:32 +0000
3+++ debian/changelog 2015-02-18 17:39:40 +0000
4@@ -1,3 +1,10 @@
5+python-eventlet (0.13.0-1ubuntu2.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> Wed, 18 Feb 2015 12:25:44 -0500
11+
12 python-eventlet (0.13.0-1ubuntu2) trusty; urgency=medium
13
14 * Rebuild to drop files installed into /usr/share/pyshared.
15
16=== modified file 'debian/patches/series'
17--- debian/patches/series 2013-10-28 10:34:13 +0000
18+++ debian/patches/series 2015-02-18 17:39:40 +0000
19@@ -1,2 +1,3 @@
20 skip-failing-tests.patch
21 fix-FTBFS-on-sphinx-build.patch
22+socket-timeout.patch
23
24=== added file 'debian/patches/socket-timeout.patch'
25--- debian/patches/socket-timeout.patch 1970-01-01 00:00:00 +0000
26+++ debian/patches/socket-timeout.patch 2015-02-18 17:39:40 +0000
27@@ -0,0 +1,87 @@
28+From 7d4916f01462de09cb58853d9de2e85777c2ad5b Mon Sep 17 00:00:00 2001
29+From: Sergey Shepelev <temotor@gmail.com>
30+Date: Fri, 9 Aug 2013 14:25:10 +0400
31+Subject: [PATCH] wsgi: configurable socket_timeout
32+
33+---
34+ eventlet/wsgi.py | 13 ++++++++++---
35+ tests/wsgi_test.py | 11 +++++++++++
36+ 2 files changed, 21 insertions(+), 3 deletions(-)
37+
38+--- a/eventlet/wsgi.py
39++++ b/eventlet/wsgi.py
40+@@ -535,7 +535,8 @@
41+ log_output=True,
42+ log_format=DEFAULT_LOG_FORMAT,
43+ url_length_limit=MAX_REQUEST_LINE,
44+- debug=True):
45++ debug=True,
46++ socket_timeout=None):
47+
48+ self.outstanding_requests = 0
49+ self.socket = socket
50+@@ -556,6 +557,7 @@
51+ self.log_format = log_format
52+ self.url_length_limit = url_length_limit
53+ self.debug = debug
54++ self.socket_timeout = socket_timeout
55+
56+ def get_environ(self):
57+ d = {
58+@@ -609,7 +611,8 @@
59+ log_output=True,
60+ log_format=DEFAULT_LOG_FORMAT,
61+ url_length_limit=MAX_REQUEST_LINE,
62+- debug=True):
63++ debug=True,
64++ socket_timeout=None):
65+ """ Start up a wsgi server handling requests from the supplied server
66+ socket. This function loops forever. The *sock* object will be closed after server exits,
67+ but the underlying file descriptor will remain open, so if you have a dup() of *sock*,
68+@@ -631,6 +634,7 @@
69+ :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.
70+ :param url_length_limit: A maximum allowed length of the request url. If exceeded, 414 error is returned.
71+ :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.
72++ :param socket_timeout: Timeout for client connections' socket operations. Default None means wait forever.
73+ """
74+ serv = Server(sock, sock.getsockname(),
75+ site, log,
76+@@ -643,7 +647,9 @@
77+ log_output=log_output,
78+ log_format=log_format,
79+ url_length_limit=url_length_limit,
80+- debug=debug)
81++ debug=debug,
82++ socket_timeout=socket_timeout,
83++ )
84+ if server_event is not None:
85+ server_event.send(serv)
86+ if max_size is None:
87+@@ -669,6 +675,7 @@
88+ while True:
89+ try:
90+ client_socket = sock.accept()
91++ client_socket[0].settimeout(serv.socket_timeout)
92+ if debug:
93+ serv.log.write("(%s) accepted %r\n" % (
94+ serv.pid, client_socket[1]))
95+--- a/tests/wsgi_test.py
96++++ b/tests/wsgi_test.py
97+@@ -1144,6 +1144,17 @@
98+ request_thread.wait()
99+ server_sock.close()
100+
101++ def test_server_socket_timeout(self):
102++ self.spawn_server(socket_timeout=0.1)
103++ sock = eventlet.connect(('localhost', self.port))
104++ sock.send('GET / HTTP/1.1\r\n')
105++ eventlet.sleep(0.1)
106++ try:
107++ read_http(sock)
108++ assert False, 'Expected ConnectionClosed exception'
109++ except ConnectionClosed:
110++ pass
111++
112+
113+ def read_headers(sock):
114+ fd = sock.makefile()

Subscribers

People subscribed via source and target branches

to all changes: