)]}'
{"etc/proxy-server.conf-sample":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"09bd2cc2886b313a64331a781c3b4894246c1839","unresolved":false,"context_lines":[{"line_number":116,"context_line":"# information using the PROXY protocol and reject any connection missing a"},{"line_number":117,"context_line":"# valid PROXY line with a 400.  Only v1 (human-readable) of the PROXY protocol"},{"line_number":118,"context_line":"# is supported."},{"line_number":119,"context_line":"# require_proxy_protocol \u003d false"},{"line_number":120,"context_line":"#"},{"line_number":121,"context_line":"# log_handoffs \u003d true"},{"line_number":122,"context_line":"# recheck_account_existence \u003d 60"}],"source_content_type":"application/octet-stream","patch_set":10,"id":"5f7c97a3_55abda1b","line":119,"updated":"2018-05-23 23:29:17.000000000","message":":-/\n\n require_proxy_protocol \u003d false\n\nmakes it sound like we might still accept and parse PROXY connections... but I don\u0027t really have a better name in mind. Something like\n\n expect_proxy_protocol\n\nruns into the *opposite* problem...","commit_id":"0b07417830767da71a3909f076c854d4954e8fcf"}],"swift/common/wsgi.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0721857b26668d3198a6493924d4bb2b9ca8c4a6","unresolved":false,"context_lines":[{"line_number":408,"context_line":"    wsgi.HttpProtocol.log_request \u003d lambda *a: None"},{"line_number":409,"context_line":"    # Redirect logging other messages by the underlying WSGI software."},{"line_number":410,"context_line":"    wsgi.HttpProtocol.log_message \u003d \\"},{"line_number":411,"context_line":"        lambda s, f, *a: logger.error(\u0027ERROR WSGI: \u0027 + f % a)"},{"line_number":412,"context_line":"    wsgi.WRITE_TIMEOUT \u003d int(conf.get(\u0027client_timeout\u0027) or 60)"},{"line_number":413,"context_line":""},{"line_number":414,"context_line":"    eventlet.hubs.use_hub(get_hub())"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_90e05dce","side":"PARENT","line":411,"updated":"2016-09-21 05:23:08.000000000","message":"so really, *this* logger *instance* is not the same logger instance we access from self.server.app.logger in log_message above","commit_id":"b4c1517ddd0d57f556721caf587c113e4abc0498"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"ffdade825ac14b93c38b4d1753aa40d46d96b99b","unresolved":false,"context_lines":[{"line_number":409,"context_line":"        \"\"\""},{"line_number":410,"context_line":"        Redirect logging other messages by the underlying WSGI software."},{"line_number":411,"context_line":"        \"\"\""},{"line_number":412,"context_line":"        logger \u003d getattr(self.server.app, \u0027logger\u0027, None)"},{"line_number":413,"context_line":"        if logger:"},{"line_number":414,"context_line":"            logger.error(\u0027ERROR WSGI: \u0027 + f % a)"},{"line_number":415,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_cfca49a1","line":412,"range":{"start_line":412,"start_character":52,"end_line":412,"end_character":56},"updated":"2016-09-21 01:07:17.000000000","message":"When would this fall back to None?","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"798a392961cb4f99306ef8c6b7142bac32eda5a4","unresolved":false,"context_lines":[{"line_number":409,"context_line":"        \"\"\""},{"line_number":410,"context_line":"        Redirect logging other messages by the underlying WSGI software."},{"line_number":411,"context_line":"        \"\"\""},{"line_number":412,"context_line":"        logger \u003d getattr(self.server.app, \u0027logger\u0027, None)"},{"line_number":413,"context_line":"        if logger:"},{"line_number":414,"context_line":"            logger.error(\u0027ERROR WSGI: \u0027 + f % a)"},{"line_number":415,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_193e0e28","line":412,"in_reply_to":"7a8ec9b2_9034ddfb","updated":"2016-09-21 15:48:09.000000000","message":"Specifically, the in-process func tests were hitting this trying to call logging methods on a None, but I decided to just make it defensive and safe here.","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0721857b26668d3198a6493924d4bb2b9ca8c4a6","unresolved":false,"context_lines":[{"line_number":409,"context_line":"        \"\"\""},{"line_number":410,"context_line":"        Redirect logging other messages by the underlying WSGI software."},{"line_number":411,"context_line":"        \"\"\""},{"line_number":412,"context_line":"        logger \u003d getattr(self.server.app, \u0027logger\u0027, None)"},{"line_number":413,"context_line":"        if logger:"},{"line_number":414,"context_line":"            logger.error(\u0027ERROR WSGI: \u0027 + f % a)"},{"line_number":415,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_9034ddfb","line":412,"in_reply_to":"7a8ec9b2_cfca49a1","updated":"2016-09-21 05:23:08.000000000","message":"anytime the left most guy in the pipeline doesn\u0027t have a logger attribute - but that should always be the gatekeeper.\n\nself.server.log would be safer, but since that\u0027s normally a NullLogger it\u0027d be be a behavior change to NOT log these messages by default","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"ffdade825ac14b93c38b4d1753aa40d46d96b99b","unresolved":false,"context_lines":[{"line_number":419,"context_line":"        \"\"\""},{"line_number":420,"context_line":"        Require HAProxy PROXY protocol, version 1."},{"line_number":421,"context_line":""},{"line_number":422,"context_line":"        See http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt"},{"line_number":423,"context_line":"        \"\"\""},{"line_number":424,"context_line":"        if self.raw_requestline.startswith(\u0027PROXY\u0027):"},{"line_number":425,"context_line":"            proxy_parts \u003d self.raw_requestline.split()"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_af2fbd3c","line":422,"range":{"start_line":422,"start_character":12,"end_line":422,"end_character":70},"updated":"2016-09-21 01:07:17.000000000","message":"There\u0027s a diff between this and http://www.haproxy.org/download/1.7/doc/proxy-protocol.txt from the commit message: http://paste.openstack.org/show/582344/. (And a bit frustratingly, there\u0027s no 2015/08/24 entry in the revision history.)\n\nWhich version are we implementing? I guess it doesn\u0027t really matter; looks like those changes have to do with the v2 protocol.","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"798a392961cb4f99306ef8c6b7142bac32eda5a4","unresolved":false,"context_lines":[{"line_number":419,"context_line":"        \"\"\""},{"line_number":420,"context_line":"        Require HAProxy PROXY protocol, version 1."},{"line_number":421,"context_line":""},{"line_number":422,"context_line":"        See http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt"},{"line_number":423,"context_line":"        \"\"\""},{"line_number":424,"context_line":"        if self.raw_requestline.startswith(\u0027PROXY\u0027):"},{"line_number":425,"context_line":"            proxy_parts \u003d self.raw_requestline.split()"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_b957da58","line":422,"in_reply_to":"7a8ec9b2_2b4c7a6f","updated":"2016-09-21 15:48:09.000000000","message":"Jeez, i looked at the 1.5 orig, then saw clay\u0027s link to a 1.7 so changed some but not others; as noted the v2 dates from like 2012 and no v1 stuff changed.  I can make all the numbers line up to not confuse people.","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0721857b26668d3198a6493924d4bb2b9ca8c4a6","unresolved":false,"context_lines":[{"line_number":419,"context_line":"        \"\"\""},{"line_number":420,"context_line":"        Require HAProxy PROXY protocol, version 1."},{"line_number":421,"context_line":""},{"line_number":422,"context_line":"        See http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt"},{"line_number":423,"context_line":"        \"\"\""},{"line_number":424,"context_line":"        if self.raw_requestline.startswith(\u0027PROXY\u0027):"},{"line_number":425,"context_line":"            proxy_parts \u003d self.raw_requestline.split()"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_2b4c7a6f","line":422,"in_reply_to":"7a8ec9b2_af2fbd3c","updated":"2016-09-21 05:23:08.000000000","message":"docstring says the version 1 protocol from the 1.5 doc - which wfm\n\nas you point out; there\u0027s no changes in the version 1 specification from 1.5 to 1.7","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"ffdade825ac14b93c38b4d1753aa40d46d96b99b","unresolved":false,"context_lines":[{"line_number":421,"context_line":""},{"line_number":422,"context_line":"        See http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt"},{"line_number":423,"context_line":"        \"\"\""},{"line_number":424,"context_line":"        if self.raw_requestline.startswith(\u0027PROXY\u0027):"},{"line_number":425,"context_line":"            proxy_parts \u003d self.raw_requestline.split()"},{"line_number":426,"context_line":"            if len(proxy_parts) !\u003d 6:"},{"line_number":427,"context_line":"                self.send_error(400, \u0027Bad PROXY line: %r\u0027 %"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_efe0e5fc","line":424,"range":{"start_line":424,"start_character":43,"end_line":424,"end_character":50},"updated":"2016-09-21 01:07:17.000000000","message":"Might be worth making this \u0027PROXY \u0027 (with a trailing space).","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"798a392961cb4f99306ef8c6b7142bac32eda5a4","unresolved":false,"context_lines":[{"line_number":421,"context_line":""},{"line_number":422,"context_line":"        See http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt"},{"line_number":423,"context_line":"        \"\"\""},{"line_number":424,"context_line":"        if self.raw_requestline.startswith(\u0027PROXY\u0027):"},{"line_number":425,"context_line":"            proxy_parts \u003d self.raw_requestline.split()"},{"line_number":426,"context_line":"            if len(proxy_parts) !\u003d 6:"},{"line_number":427,"context_line":"                self.send_error(400, \u0027Bad PROXY line: %r\u0027 %"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_594976b6","line":424,"range":{"start_line":424,"start_character":43,"end_line":424,"end_character":50},"in_reply_to":"7a8ec9b2_efe0e5fc","updated":"2016-09-21 15:48:09.000000000","message":"What does that improve?","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0721857b26668d3198a6493924d4bb2b9ca8c4a6","unresolved":false,"context_lines":[{"line_number":421,"context_line":""},{"line_number":422,"context_line":"        See http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt"},{"line_number":423,"context_line":"        \"\"\""},{"line_number":424,"context_line":"        if self.raw_requestline.startswith(\u0027PROXY\u0027):"},{"line_number":425,"context_line":"            proxy_parts \u003d self.raw_requestline.split()"},{"line_number":426,"context_line":"            if len(proxy_parts) !\u003d 6:"},{"line_number":427,"context_line":"                self.send_error(400, \u0027Bad PROXY line: %r\u0027 %"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_4b30e6e8","line":424,"in_reply_to":"7a8ec9b2_efe0e5fc","updated":"2016-09-21 05:23:08.000000000","message":"i like that!","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"ffdade825ac14b93c38b4d1753aa40d46d96b99b","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        See http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt"},{"line_number":423,"context_line":"        \"\"\""},{"line_number":424,"context_line":"        if self.raw_requestline.startswith(\u0027PROXY\u0027):"},{"line_number":425,"context_line":"            proxy_parts \u003d self.raw_requestline.split()"},{"line_number":426,"context_line":"            if len(proxy_parts) !\u003d 6:"},{"line_number":427,"context_line":"                self.send_error(400, \u0027Bad PROXY line: %r\u0027 %"},{"line_number":428,"context_line":"                                self.raw_requestline)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_8f7921ff","line":425,"range":{"start_line":425,"start_character":46,"end_line":425,"end_character":54},"updated":"2016-09-21 01:07:17.000000000","message":"The linked spec is pretty explicit about \"exactly one space\" -- should this be\n\n proxy_parts \u003d self.raw_requestline.split(\u0027 \u0027)\n\n?","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"798a392961cb4f99306ef8c6b7142bac32eda5a4","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        See http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt"},{"line_number":423,"context_line":"        \"\"\""},{"line_number":424,"context_line":"        if self.raw_requestline.startswith(\u0027PROXY\u0027):"},{"line_number":425,"context_line":"            proxy_parts \u003d self.raw_requestline.split()"},{"line_number":426,"context_line":"            if len(proxy_parts) !\u003d 6:"},{"line_number":427,"context_line":"                self.send_error(400, \u0027Bad PROXY line: %r\u0027 %"},{"line_number":428,"context_line":"                                self.raw_requestline)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_999bfe17","line":425,"range":{"start_line":425,"start_character":46,"end_line":425,"end_character":54},"in_reply_to":"7a8ec9b2_8f7921ff","updated":"2016-09-21 15:48:09.000000000","message":"Noted verbally to Clay that the validation here is a bit looser than the spec.","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0721857b26668d3198a6493924d4bb2b9ca8c4a6","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        See http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt"},{"line_number":423,"context_line":"        \"\"\""},{"line_number":424,"context_line":"        if self.raw_requestline.startswith(\u0027PROXY\u0027):"},{"line_number":425,"context_line":"            proxy_parts \u003d self.raw_requestline.split()"},{"line_number":426,"context_line":"            if len(proxy_parts) !\u003d 6:"},{"line_number":427,"context_line":"                self.send_error(400, \u0027Bad PROXY line: %r\u0027 %"},{"line_number":428,"context_line":"                                self.raw_requestline)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_eb3a92cc","line":425,"in_reply_to":"7a8ec9b2_8f7921ff","updated":"2016-09-21 05:23:08.000000000","message":"only if it\u0027s quicker than splitting on any whitespace?","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"ffdade825ac14b93c38b4d1753aa40d46d96b99b","unresolved":false,"context_lines":[{"line_number":426,"context_line":"            if len(proxy_parts) !\u003d 6:"},{"line_number":427,"context_line":"                self.send_error(400, \u0027Bad PROXY line: %r\u0027 %"},{"line_number":428,"context_line":"                                self.raw_requestline)"},{"line_number":429,"context_line":"                return False"},{"line_number":430,"context_line":"            self.client_address \u003d (proxy_parts[2], proxy_parts[4])"},{"line_number":431,"context_line":"            self.raw_requestline \u003d self.rfile.readline("},{"line_number":432,"context_line":"                self.server.url_length_limit)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_2ffe4d38","line":429,"updated":"2016-09-21 01:07:17.000000000","message":"Should we do any other validation here? proxy_parts[1] in (\u0027TCP4\u0027, \u0027TCP6\u0027)? IP address validation?","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"798a392961cb4f99306ef8c6b7142bac32eda5a4","unresolved":false,"context_lines":[{"line_number":426,"context_line":"            if len(proxy_parts) !\u003d 6:"},{"line_number":427,"context_line":"                self.send_error(400, \u0027Bad PROXY line: %r\u0027 %"},{"line_number":428,"context_line":"                                self.raw_requestline)"},{"line_number":429,"context_line":"                return False"},{"line_number":430,"context_line":"            self.client_address \u003d (proxy_parts[2], proxy_parts[4])"},{"line_number":431,"context_line":"            self.raw_requestline \u003d self.rfile.readline("},{"line_number":432,"context_line":"                self.server.url_length_limit)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_d9b82678","line":429,"in_reply_to":"7a8ec9b2_2ffe4d38","updated":"2016-09-21 15:48:09.000000000","message":"Probably unnecessary.","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0721857b26668d3198a6493924d4bb2b9ca8c4a6","unresolved":false,"context_lines":[{"line_number":426,"context_line":"            if len(proxy_parts) !\u003d 6:"},{"line_number":427,"context_line":"                self.send_error(400, \u0027Bad PROXY line: %r\u0027 %"},{"line_number":428,"context_line":"                                self.raw_requestline)"},{"line_number":429,"context_line":"                return False"},{"line_number":430,"context_line":"            self.client_address \u003d (proxy_parts[2], proxy_parts[4])"},{"line_number":431,"context_line":"            self.raw_requestline \u003d self.rfile.readline("},{"line_number":432,"context_line":"                self.server.url_length_limit)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_ab208a9c","line":429,"in_reply_to":"7a8ec9b2_2ffe4d38","updated":"2016-09-21 05:23:08.000000000","message":"i vote not? liberal in what you accept and all that.\n\nUnless you think allowing bits of information into these fields that no one looks at or cares about exposes exposes some sort of vulnerability?","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0721857b26668d3198a6493924d4bb2b9ca8c4a6","unresolved":false,"context_lines":[{"line_number":431,"context_line":"            self.raw_requestline \u003d self.rfile.readline("},{"line_number":432,"context_line":"                self.server.url_length_limit)"},{"line_number":433,"context_line":"            return wsgi.HttpProtocol.parse_request(self)"},{"line_number":434,"context_line":"        self.send_error(400, \u0027Missing required PROXY line\u0027)"},{"line_number":435,"context_line":"        return False"},{"line_number":436,"context_line":""},{"line_number":437,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_30dce911","line":434,"updated":"2016-09-21 05:23:08.000000000","message":"FWIW, these send_error calls in parser_request are basically the only log messages we ever see spit out via log_message.  There\u0027s a few like \"Bad HTTP protocol version\" and the like in addition to these seem reasonable to keep in the proxy-server logger.","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"798a392961cb4f99306ef8c6b7142bac32eda5a4","unresolved":false,"context_lines":[{"line_number":431,"context_line":"            self.raw_requestline \u003d self.rfile.readline("},{"line_number":432,"context_line":"                self.server.url_length_limit)"},{"line_number":433,"context_line":"            return wsgi.HttpProtocol.parse_request(self)"},{"line_number":434,"context_line":"        self.send_error(400, \u0027Missing required PROXY line\u0027)"},{"line_number":435,"context_line":"        return False"},{"line_number":436,"context_line":""},{"line_number":437,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_f926c2cc","line":434,"in_reply_to":"7a8ec9b2_30dce911","updated":"2016-09-21 15:48:09.000000000","message":"What do you want me to do? also log this stuff via self.log_message(...)?","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0721857b26668d3198a6493924d4bb2b9ca8c4a6","unresolved":false,"context_lines":[{"line_number":474,"context_line":"        protocol_class \u003d SwiftHttpProxiedProtocol"},{"line_number":475,"context_line":"    else:"},{"line_number":476,"context_line":"        protocol_class \u003d SwiftHttpProtocol"},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"    server_kwargs \u003d {"},{"line_number":479,"context_line":"        \u0027custom_pool\u0027: pool,"},{"line_number":480,"context_line":"        \u0027protocol\u0027: protocol_class,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_6ba122a9","line":477,"updated":"2016-09-21 05:23:08.000000000","message":"maybe right here just go ahead and set the logger as a class attribute?\n\n    protocol_class._swift_logger \u003d logger\n\nThen use it in log_message?\n\n    self._swift_logger.error(\u0027WSGI ERROR ...)","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"798a392961cb4f99306ef8c6b7142bac32eda5a4","unresolved":false,"context_lines":[{"line_number":474,"context_line":"        protocol_class \u003d SwiftHttpProxiedProtocol"},{"line_number":475,"context_line":"    else:"},{"line_number":476,"context_line":"        protocol_class \u003d SwiftHttpProtocol"},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"    server_kwargs \u003d {"},{"line_number":479,"context_line":"        \u0027custom_pool\u0027: pool,"},{"line_number":480,"context_line":"        \u0027protocol\u0027: protocol_class,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_3c1bb874","line":477,"in_reply_to":"7a8ec9b2_6ba122a9","updated":"2016-09-21 15:48:09.000000000","message":"considered that but the in-process func dudes have many servers in one process (memory space), so...I didn\u0027t.","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f8087b9486d08a391af034b0738220994fd23f5d","unresolved":false,"context_lines":[{"line_number":421,"context_line":""},{"line_number":422,"context_line":"        See http://www.haproxy.org/download/1.7/doc/proxy-protocol.txt"},{"line_number":423,"context_line":"        \"\"\""},{"line_number":424,"context_line":"        if self.raw_requestline.startswith(\u0027PROXY\u0027):"},{"line_number":425,"context_line":"            proxy_parts \u003d self.raw_requestline.split()"},{"line_number":426,"context_line":"            if len(proxy_parts) !\u003d 6:"},{"line_number":427,"context_line":"                self.send_error(400, \u0027Bad PROXY line: %r\u0027 %"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a8ec9b2_d46612ba","line":424,"range":{"start_line":424,"start_character":43,"end_line":424,"end_character":50},"updated":"2016-09-22 01:17:19.000000000","message":"\u003e What does that improve?\n\nUsing \u0027PROXY \u0027 (with the space) would have us immediately 400 weird requests like\n\n PROXYbutnotreally blah blah blah blah blah","commit_id":"6aebc75aa9593d38472b7ad5792437af2f6634a0"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4f564fae0eadaec50f13e9c16a89204fef279d21","unresolved":false,"context_lines":[{"line_number":427,"context_line":"                known \u003d False"},{"line_number":428,"context_line":"                if proxy_parts[1] in (\u0027TCP4\u0027, \u0027TCP6\u0027) and \\"},{"line_number":429,"context_line":"                        len(proxy_parts) \u003d\u003d 6:"},{"line_number":430,"context_line":"                    self.client_address \u003d (proxy_parts[2], proxy_parts[4])"},{"line_number":431,"context_line":"                    known \u003d True"},{"line_number":432,"context_line":"                if known or proxy_parts[1].startswith(\u0027UNKNOWN\u0027):"},{"line_number":433,"context_line":"                    self.raw_requestline \u003d self.rfile.readline("}],"source_content_type":"text/x-python","patch_set":3,"id":"5a8bc5a2_63ab4d8a","line":430,"updated":"2016-09-22 18:27:40.000000000","message":"I kinda feel like proxy_parts[3] and proxy_parts[5] should make their way to env[\u0027SERVER_NAME\u0027] and env[\u0027SERVER_PORT\u0027] eventually.\n\nMaybe even use a port of 443 to assume https? Eventlet looks at the actual socket [1], but if we did *all* of these things, I think this might give us a way to close bug 1532337 and bug 1572011 without needing to plumb scheme/host/port into our configs like in https://review.openstack.org/#/c/372809/.\n\n[1] https://github.com/eventlet/eventlet/blob/v0.19.0/eventlet/wsgi.py#L701-L704","commit_id":"a28c52e1434609ba2be3fbfe2f39f38b8bd3b47e"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"ea5f45ede994d761eb57ded33ad4b3e92d4b109c","unresolved":false,"context_lines":[{"line_number":427,"context_line":"                known \u003d False"},{"line_number":428,"context_line":"                if proxy_parts[1] in (\u0027TCP4\u0027, \u0027TCP6\u0027) and \\"},{"line_number":429,"context_line":"                        len(proxy_parts) \u003d\u003d 6:"},{"line_number":430,"context_line":"                    self.client_address \u003d (proxy_parts[2], proxy_parts[4])"},{"line_number":431,"context_line":"                    known \u003d True"},{"line_number":432,"context_line":"                if known or proxy_parts[1].startswith(\u0027UNKNOWN\u0027):"},{"line_number":433,"context_line":"                    self.raw_requestline \u003d self.rfile.readline("}],"source_content_type":"text/x-python","patch_set":3,"id":"5a8bc5a2_d8ca47a1","line":430,"in_reply_to":"5a8bc5a2_63ab4d8a","updated":"2016-09-22 20:06:01.000000000","message":"I think this is out of scope.","commit_id":"a28c52e1434609ba2be3fbfe2f39f38b8bd3b47e"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"24b3e47c17c727a846e9f45681b6753ac775e7f7","unresolved":false,"context_lines":[{"line_number":427,"context_line":"                known \u003d False"},{"line_number":428,"context_line":"                if proxy_parts[1] in (\u0027TCP4\u0027, \u0027TCP6\u0027) and \\"},{"line_number":429,"context_line":"                        len(proxy_parts) \u003d\u003d 6:"},{"line_number":430,"context_line":"                    self.client_address \u003d (proxy_parts[2], proxy_parts[4])"},{"line_number":431,"context_line":"                    known \u003d True"},{"line_number":432,"context_line":"                if known or proxy_parts[1].startswith(\u0027UNKNOWN\u0027):"},{"line_number":433,"context_line":"                    self.raw_requestline \u003d self.rfile.readline("}],"source_content_type":"text/x-python","patch_set":3,"id":"5a8bc5a2_8f46b821","line":430,"in_reply_to":"5a8bc5a2_63ab4d8a","updated":"2016-09-22 18:51:47.000000000","message":"is it reasonable to make those fixes dependent on running behind a proxy that supports this protocol?  I don\u0027t know.  It\u0027s probably worth it to consider as... a follow up?","commit_id":"a28c52e1434609ba2be3fbfe2f39f38b8bd3b47e"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"762a38273bc7e14a95c404033a2c118aba82dcb8","unresolved":false,"context_lines":[{"line_number":411,"context_line":"        \"\"\""},{"line_number":412,"context_line":"        logger \u003d getattr(self.server.app, \u0027logger\u0027, None)"},{"line_number":413,"context_line":"        if logger:"},{"line_number":414,"context_line":"            logger.error(\u0027ERROR WSGI: \u0027 + f % a)"},{"line_number":415,"context_line":""},{"line_number":416,"context_line":""},{"line_number":417,"context_line":"class SwiftHttpProxiedProtocol(SwiftHttpProtocol):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_c21169ae","line":414,"updated":"2016-09-23 02:07:50.000000000","message":"nit: it\u0027s possible that it just so happens that our left hand most filter will always has a logger attribute; but I think it\u0027s kinda of brittle (someone renamed logger to _logger in gatekeeper and now WSGI Errors don\u0027t get logged)\n\nMaybe it\u0027s paranoia, but I think a better fall back than \"don\u0027t log\" is to \"log to stderr\" (at least when eventlet_debug is turned on)\n\nhttps://gist.github.com/clayg/36b7350ea3ebefaee753aab6ce8c4382","commit_id":"dd13cc7ea9fb0da1d9f7a783fcfbc2fb4aeff752"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"762a38273bc7e14a95c404033a2c118aba82dcb8","unresolved":false,"context_lines":[{"line_number":436,"context_line":"            self.send_error(400, \u0027Bad PROXY line: %r\u0027 %"},{"line_number":437,"context_line":"                            self.raw_requestline)"},{"line_number":438,"context_line":"            return False"},{"line_number":439,"context_line":"        self.send_error(400, \u0027Missing required PROXY line\u0027)"},{"line_number":440,"context_line":"        return False"},{"line_number":441,"context_line":""},{"line_number":442,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_42ab9974","line":439,"updated":"2016-09-23 02:07:50.000000000","message":"So it turns out that using send_error before the parent class gets a chance to do some setup in parse_request causes stuff to blow up.\n\nI think I saw this when I send a regular http request to my requrie_proxy_protocol server\n\nhttps://gist.github.com/clayg/80368d1aed6a512e962bc6ea07d54e0b\n\nI just cribbed a couple of lines from BaseHTTPServer.BaseHTTPRequestHandler and send_error started working\n\nI think it\u0027d be kind of a weird behavior to debug","commit_id":"dd13cc7ea9fb0da1d9f7a783fcfbc2fb4aeff752"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"c9e01a0929e4910c152e78c8c8fbec52dfa15fa0","unresolved":false,"context_lines":[{"line_number":436,"context_line":"                    known \u003d True"},{"line_number":437,"context_line":"                if known or proxy_parts[1].startswith(\u0027UNKNOWN\u0027):"},{"line_number":438,"context_line":"                    self.raw_requestline \u003d self.rfile.readline("},{"line_number":439,"context_line":"                        self.server.url_length_limit)"},{"line_number":440,"context_line":"                    return wsgi.HttpProtocol.parse_request(self)"},{"line_number":441,"context_line":"            self.send_error(400, \u0027Bad PROXY line: %r\u0027 %"},{"line_number":442,"context_line":"                            self.raw_requestline)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a8bc5a2_8cf2066e","line":439,"updated":"2016-09-23 19:02:04.000000000","message":"I was thinking about IO and timeouts here, and initially I thought we\u0027d need to wrap this in an eventlet.Timeout. However, I looked at the call site for parse_request in `eventlet.wsgi.HttpProtocol.handle_one_request()`, and also the superclass\u0027s parse_request in stdlib, and both of them are doing IO without apparent timeout handling, so I guess it\u0027s handled somehow.","commit_id":"3351856b1144a01619d1238f8f39f90aa04b119d"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"ca55badf37cd18642e49ffd8f8a2f88fb09a1da0","unresolved":false,"context_lines":[{"line_number":415,"context_line":""},{"line_number":416,"context_line":"class SwiftHttpProxiedProtocol(SwiftHttpProtocol):"},{"line_number":417,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":418,"context_line":"        SwiftHttpProtocol.__init__(self, *args, **kwargs)"},{"line_number":419,"context_line":"        self._proxied_protocol_first_request \u003d True"},{"line_number":420,"context_line":""},{"line_number":421,"context_line":"    def parse_request(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a8bc5a2_07ae75e5","line":418,"updated":"2016-09-26 22:30:05.000000000","message":"Note to other reviewers: the inheritance here looks like\n\n    SwiftHttpProxiedProtocol \u003c SwiftHttpProtocol \u003c eventlet.wsgi.HttpProtocol \u003c BaseHTTPServer.BaseHTTPRequestHandler \u003c SocketServer.StreamRequestHandler \u003c SocketServer.BaseRequestHandler\n\nAll the way down at the bottom, we have an old-style class that doesn\u0027t inherit from object, so we can\u0027t use super() here. The old, crappy form of superclass call is, in fact, necessary.","commit_id":"6e79e5693eb083737f5934def76127f142023d79"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f78d49e174a36c6072c1090ef28a80cfc48930d4","unresolved":false,"context_lines":[{"line_number":425,"context_line":"        See http://www.haproxy.org/download/1.7/doc/proxy-protocol.txt"},{"line_number":426,"context_line":"        \"\"\""},{"line_number":427,"context_line":"        if not self._proxied_protocol_first_request:"},{"line_number":428,"context_line":"            return SwiftHttpProtocol.parse_request(self)"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        self._proxied_protocol_first_request \u003d False"},{"line_number":431,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a629dbe_b6020a3d","line":428,"updated":"2018-05-21 18:24:53.000000000","message":"I think this is indicating that we\u0027re taking on this problem in the wrong place.","commit_id":"6e79e5693eb083737f5934def76127f142023d79"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f78d49e174a36c6072c1090ef28a80cfc48930d4","unresolved":false,"context_lines":[{"line_number":452,"context_line":"                    # instance.  So we reach in for the original self.rfile as"},{"line_number":453,"context_line":"                    # self.rfile.fp"},{"line_number":454,"context_line":"                    self.raw_requestline \u003d self.rfile.fp.readline("},{"line_number":455,"context_line":"                        self.server.url_length_limit)"},{"line_number":456,"context_line":"                    return SwiftHttpProtocol.parse_request(self)"},{"line_number":457,"context_line":"            self.send_error(400, \u0027Bad PROXY line: %r\u0027 %"},{"line_number":458,"context_line":"                            self.raw_requestline)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a629dbe_96bb4672","line":455,"updated":"2018-05-21 18:24:53.000000000","message":"I think we\u0027ve had some trouble with upgrading eventlet versions when we go digging to far behind eventlet\u0027s interfaces.","commit_id":"6e79e5693eb083737f5934def76127f142023d79"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"ca55badf37cd18642e49ffd8f8a2f88fb09a1da0","unresolved":false,"context_lines":[{"line_number":457,"context_line":"            self.send_error(400, \u0027Bad PROXY line: %r\u0027 %"},{"line_number":458,"context_line":"                            self.raw_requestline)"},{"line_number":459,"context_line":"            return False"},{"line_number":460,"context_line":"        self.send_error(400, \u0027Missing required PROXY line\u0027)"},{"line_number":461,"context_line":"        return False"},{"line_number":462,"context_line":""},{"line_number":463,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5a8bc5a2_c70bad22","line":460,"updated":"2016-09-26 22:30:05.000000000","message":"Can we do something else here? The one who needs the error is the administrator who hasn\u0027t got the PROXY protocol turned on.\n\nI\u0027m not saying to take out the 400; it\u0027s helpful for when an admin comes along and uses curl to talk HTTP sans PROXY-line to a swift-proxy-server process. I just think we also need to complain loudly in the logs so that if someone, for example, misconfigures their SSL terminator and turns off the PROXY protocol, then they see complaints in their logs.","commit_id":"6e79e5693eb083737f5934def76127f142023d79"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"008f7a3e4c291393e98e7fa33c5552f52d8f7ee9","unresolved":false,"context_lines":[{"line_number":425,"context_line":"        See http://www.haproxy.org/download/1.7/doc/proxy-protocol.txt"},{"line_number":426,"context_line":"        \"\"\""},{"line_number":427,"context_line":"        if not self._proxied_protocol_first_request:"},{"line_number":428,"context_line":"            return SwiftHttpProtocol.parse_request(self)"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        self._proxied_protocol_first_request \u003d False"},{"line_number":431,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a629dbe_b65e8a43","line":428,"updated":"2016-11-07 20:27:22.000000000","message":"I think this is indicating that we\u0027re attacking this problem in the wrong place.","commit_id":"17b8ea72268a3786e13129dfd5d9db56b548880b"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"1e566eccd329c4d15a91cda42458c17e39b4eed1","unresolved":false,"context_lines":[{"line_number":425,"context_line":"        See http://www.haproxy.org/download/1.7/doc/proxy-protocol.txt"},{"line_number":426,"context_line":"        \"\"\""},{"line_number":427,"context_line":"        if not self._proxied_protocol_first_request:"},{"line_number":428,"context_line":"            return SwiftHttpProtocol.parse_request(self)"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        self._proxied_protocol_first_request \u003d False"},{"line_number":431,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f044301_0efeb736","line":428,"in_reply_to":"9a629dbe_b65e8a43","updated":"2017-05-05 18:36:15.000000000","message":"Although I agree that using HttpProtocol is undesirable, because it\u0027s marked deprecated, the same kind of fall-through is unavoidable in case Darrell wraps a socket instead. Works great for SSL where some meaningful additional computation is done for each packet, but... Maybe there\u0027s a possibility of somehow fetching just the 1st line, and only instantiating wsgi.server with the straight-up socket from that point onwards.","commit_id":"17b8ea72268a3786e13129dfd5d9db56b548880b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"008f7a3e4c291393e98e7fa33c5552f52d8f7ee9","unresolved":false,"context_lines":[{"line_number":452,"context_line":"                    # instance.  So we reach in for the original self.rfile as"},{"line_number":453,"context_line":"                    # self.rfile.fp"},{"line_number":454,"context_line":"                    self.raw_requestline \u003d self.rfile.fp.readline("},{"line_number":455,"context_line":"                        self.server.url_length_limit)"},{"line_number":456,"context_line":"                    return SwiftHttpProtocol.parse_request(self)"},{"line_number":457,"context_line":"            errmsg \u003d \u0027Bad PROXY line: %r\u0027 % self.raw_requestline"},{"line_number":458,"context_line":"            self.log_message(errmsg)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a629dbe_56360e04","line":455,"updated":"2016-11-07 20:27:22.000000000","message":"we\u0027ve had some problems int he past with upgrading eventlet when we we go digging too deep behind it\u0027s interfaces","commit_id":"17b8ea72268a3786e13129dfd5d9db56b548880b"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"e9828456ef6afef8d8214f920e4c3797130b2d77","unresolved":false,"context_lines":[{"line_number":452,"context_line":"                    # instance.  So we reach in for the original self.rfile as"},{"line_number":453,"context_line":"                    # self.rfile.fp"},{"line_number":454,"context_line":"                    self.raw_requestline \u003d self.rfile.fp.readline("},{"line_number":455,"context_line":"                        self.server.url_length_limit)"},{"line_number":456,"context_line":"                    return SwiftHttpProtocol.parse_request(self)"},{"line_number":457,"context_line":"            errmsg \u003d \u0027Bad PROXY line: %r\u0027 % self.raw_requestline"},{"line_number":458,"context_line":"            self.log_message(errmsg)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a629dbe_7920639c","line":455,"in_reply_to":"9a629dbe_56360e04","updated":"2016-11-16 19:54:57.000000000","message":"True. I suppose at least we aren\u0027t mucking about in the Python standard library...","commit_id":"17b8ea72268a3786e13129dfd5d9db56b548880b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"f78d49e174a36c6072c1090ef28a80cfc48930d4","unresolved":false,"context_lines":[{"line_number":451,"context_line":"        if not self._proxied_protocol_first_request:"},{"line_number":452,"context_line":"            return SwiftHttpProtocol.parse_request(self)"},{"line_number":453,"context_line":""},{"line_number":454,"context_line":"        self._proxied_protocol_first_request \u003d False"},{"line_number":455,"context_line":""},{"line_number":456,"context_line":"        # Superclass requires these set prior to calling send_error(), so we"},{"line_number":457,"context_line":"        # set them here, before we might call send_error."}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_4b435b14","line":454,"updated":"2018-05-21 18:24:53.000000000","message":"This state tracking stuff *works* but it\u0027s pretty much bullshit.  We\u0027re overriding the wrong method.  This is for each *request* - each *connection* should be dealt with in \"handle\".\n\nbut... whatever - gross works I guess...","commit_id":"d1052d8844c9ffa9d5428ed6972f358654371a71"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"09bd2cc2886b313a64331a781c3b4894246c1839","unresolved":false,"context_lines":[{"line_number":423,"context_line":"class SwiftHttpProtocol(wsgi.HttpProtocol):"},{"line_number":424,"context_line":"    default_request_version \u003d \"HTTP/1.0\""},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    def log_request(*a):"},{"line_number":427,"context_line":"        \"\"\""},{"line_number":428,"context_line":"        Turn off logging requests by the underlying WSGI software."},{"line_number":429,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"5f7c97a3_15a1e2a9","line":426,"range":{"start_line":426,"start_character":20,"end_line":426,"end_character":22},"updated":"2018-05-23 23:29:17.000000000","message":"Might be worth spelling out\n\n def log_request(self, *a):\n\njust for our future sanity.","commit_id":"0b07417830767da71a3909f076c854d4954e8fcf"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"58377a0bbf7b1d6531092d2be430ca586bfc3ba2","unresolved":false,"context_lines":[{"line_number":423,"context_line":"class SwiftHttpProtocol(wsgi.HttpProtocol):"},{"line_number":424,"context_line":"    default_request_version \u003d \"HTTP/1.0\""},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    def log_request(*a):"},{"line_number":427,"context_line":"        \"\"\""},{"line_number":428,"context_line":"        Turn off logging requests by the underlying WSGI software."},{"line_number":429,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"5f7c97a3_3863b3b3","line":426,"range":{"start_line":426,"start_character":20,"end_line":426,"end_character":22},"in_reply_to":"5f7c97a3_15a1e2a9","updated":"2018-05-24 01:10:47.000000000","message":"Done","commit_id":"0b07417830767da71a3909f076c854d4954e8fcf"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"09bd2cc2886b313a64331a781c3b4894246c1839","unresolved":false,"context_lines":[{"line_number":434,"context_line":"        Redirect logging other messages by the underlying WSGI software."},{"line_number":435,"context_line":"        \"\"\""},{"line_number":436,"context_line":"        logger \u003d getattr(self.server.app, \u0027logger\u0027, None) or self.server.log"},{"line_number":437,"context_line":"        logger.error(\u0027ERROR WSGI: \u0027 + f % a)"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"class SwiftHttpProxiedProtocol(SwiftHttpProtocol):"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f7c97a3_f5ad469b","line":437,"updated":"2018-05-23 23:29:17.000000000","message":"Can\u0027t we do\n\n logger.error(\u0027ERROR WSGI: \u0027 + f, a)\n\n?","commit_id":"0b07417830767da71a3909f076c854d4954e8fcf"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"58377a0bbf7b1d6531092d2be430ca586bfc3ba2","unresolved":false,"context_lines":[{"line_number":434,"context_line":"        Redirect logging other messages by the underlying WSGI software."},{"line_number":435,"context_line":"        \"\"\""},{"line_number":436,"context_line":"        logger \u003d getattr(self.server.app, \u0027logger\u0027, None) or self.server.log"},{"line_number":437,"context_line":"        logger.error(\u0027ERROR WSGI: \u0027 + f % a)"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"class SwiftHttpProxiedProtocol(SwiftHttpProtocol):"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f7c97a3_9873e780","line":437,"in_reply_to":"5f7c97a3_f5ad469b","updated":"2018-05-24 01:10:47.000000000","message":"Done","commit_id":"0b07417830767da71a3909f076c854d4954e8fcf"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"09bd2cc2886b313a64331a781c3b4894246c1839","unresolved":false,"context_lines":[{"line_number":437,"context_line":"        logger.error(\u0027ERROR WSGI: \u0027 + f % a)"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"class SwiftHttpProxiedProtocol(SwiftHttpProtocol):"},{"line_number":441,"context_line":"    def handle_error(self, connection_line):"},{"line_number":442,"context_line":"        if not six.PY2:"},{"line_number":443,"context_line":"            connection_line \u003d connection_line.decode(\u0027latin-1\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f7c97a3_55219afa","line":440,"updated":"2018-05-23 23:29:17.000000000","message":"I feel like this could use a link to http://www.haproxy.org/download/1.7/doc/proxy-protocol.txt in a comment or something.","commit_id":"0b07417830767da71a3909f076c854d4954e8fcf"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"58377a0bbf7b1d6531092d2be430ca586bfc3ba2","unresolved":false,"context_lines":[{"line_number":437,"context_line":"        logger.error(\u0027ERROR WSGI: \u0027 + f % a)"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"class SwiftHttpProxiedProtocol(SwiftHttpProtocol):"},{"line_number":441,"context_line":"    def handle_error(self, connection_line):"},{"line_number":442,"context_line":"        if not six.PY2:"},{"line_number":443,"context_line":"            connection_line \u003d connection_line.decode(\u0027latin-1\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f7c97a3_b8f343e7","line":440,"in_reply_to":"5f7c97a3_55219afa","updated":"2018-05-24 01:10:47.000000000","message":"Done","commit_id":"0b07417830767da71a3909f076c854d4954e8fcf"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"09bd2cc2886b313a64331a781c3b4894246c1839","unresolved":false,"context_lines":[{"line_number":458,"context_line":"        self.request_version \u003d self.default_request_version"},{"line_number":459,"context_line":"        # appease http.server"},{"line_number":460,"context_line":"        self.command \u003d \u0027PROXY\u0027"},{"line_number":461,"context_line":"        self.send_error(400, msg)"},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"    def handle(self):"},{"line_number":464,"context_line":"        \"\"\"Handle multiple requests if necessary.\"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"5f7c97a3_1506c287","line":461,"updated":"2018-05-23 23:29:17.000000000","message":"So under py3... msg automatically get latin-1 encoded?","commit_id":"0b07417830767da71a3909f076c854d4954e8fcf"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"58377a0bbf7b1d6531092d2be430ca586bfc3ba2","unresolved":false,"context_lines":[{"line_number":458,"context_line":"        self.request_version \u003d self.default_request_version"},{"line_number":459,"context_line":"        # appease http.server"},{"line_number":460,"context_line":"        self.command \u003d \u0027PROXY\u0027"},{"line_number":461,"context_line":"        self.send_error(400, msg)"},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"    def handle(self):"},{"line_number":464,"context_line":"        \"\"\"Handle multiple requests if necessary.\"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"5f7c97a3_78160bf4","line":461,"in_reply_to":"5f7c97a3_1506c287","updated":"2018-05-24 01:10:47.000000000","message":"Yep. Look in http/server.py for the BaseHTTPRequestHandler.send_header method.","commit_id":"0b07417830767da71a3909f076c854d4954e8fcf"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"09bd2cc2886b313a64331a781c3b4894246c1839","unresolved":false,"context_lines":[{"line_number":465,"context_line":"        # ensure the opening line for the connection is a valid PROXY protcol"},{"line_number":466,"context_line":"        # line; this is the only IO we do on this connection before any"},{"line_number":467,"context_line":"        # additional wrapping further pollutes the raw socket."},{"line_number":468,"context_line":"        connection_line \u003d self.rfile.readline(self.server.url_length_limit)"},{"line_number":469,"context_line":""},{"line_number":470,"context_line":"        if connection_line.startswith(b\u0027PROXY\u0027):"},{"line_number":471,"context_line":"            proxy_parts \u003d connection_line.split()"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f7c97a3_35cade19","line":468,"range":{"start_line":468,"start_character":58,"end_line":468,"end_character":74},"updated":"2018-05-23 23:29:17.000000000","message":"Good; eventlet says\n\n MAX_REQUEST_LINE \u003d 8192\n\nwhich is well above the 107 chars called out in the PROXY spec.","commit_id":"0b07417830767da71a3909f076c854d4954e8fcf"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"09bd2cc2886b313a64331a781c3b4894246c1839","unresolved":false,"context_lines":[{"line_number":468,"context_line":"        connection_line \u003d self.rfile.readline(self.server.url_length_limit)"},{"line_number":469,"context_line":""},{"line_number":470,"context_line":"        if connection_line.startswith(b\u0027PROXY\u0027):"},{"line_number":471,"context_line":"            proxy_parts \u003d connection_line.split()"},{"line_number":472,"context_line":"            if len(proxy_parts) \u003e\u003d 2 and proxy_parts[0] \u003d\u003d b\u0027PROXY\u0027:"},{"line_number":473,"context_line":"                if proxy_parts[1] in (b\u0027TCP4\u0027, b\u0027TCP6\u0027) and \\"},{"line_number":474,"context_line":"                        len(proxy_parts) \u003d\u003d 6:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f7c97a3_3565fe45","line":471,"range":{"start_line":471,"start_character":42,"end_line":471,"end_character":49},"updated":"2018-05-23 23:29:17.000000000","message":"Should this be explicitly\n\n .split(\u0027 \u0027)\n\n?","commit_id":"0b07417830767da71a3909f076c854d4954e8fcf"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"58377a0bbf7b1d6531092d2be430ca586bfc3ba2","unresolved":false,"context_lines":[{"line_number":468,"context_line":"        connection_line \u003d self.rfile.readline(self.server.url_length_limit)"},{"line_number":469,"context_line":""},{"line_number":470,"context_line":"        if connection_line.startswith(b\u0027PROXY\u0027):"},{"line_number":471,"context_line":"            proxy_parts \u003d connection_line.split()"},{"line_number":472,"context_line":"            if len(proxy_parts) \u003e\u003d 2 and proxy_parts[0] \u003d\u003d b\u0027PROXY\u0027:"},{"line_number":473,"context_line":"                if proxy_parts[1] in (b\u0027TCP4\u0027, b\u0027TCP6\u0027) and \\"},{"line_number":474,"context_line":"                        len(proxy_parts) \u003d\u003d 6:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f7c97a3_18d3573a","line":471,"range":{"start_line":471,"start_character":42,"end_line":471,"end_character":49},"in_reply_to":"5f7c97a3_3565fe45","updated":"2018-05-24 01:10:47.000000000","message":"Sure, why not?","commit_id":"0b07417830767da71a3909f076c854d4954e8fcf"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"09bd2cc2886b313a64331a781c3b4894246c1839","unresolved":false,"context_lines":[{"line_number":477,"context_line":"                    else:"},{"line_number":478,"context_line":"                        self.client_address \u003d ("},{"line_number":479,"context_line":"                            proxy_parts[2].decode(\u0027latin-1\u0027),"},{"line_number":480,"context_line":"                            proxy_parts[4].decode(\u0027latin-1\u0027))"},{"line_number":481,"context_line":"                elif proxy_parts[1].startswith(b\u0027UNKNOWN\u0027):"},{"line_number":482,"context_line":"                    # \"UNKNOWN\", in PROXY protocol version 1, means \"not"},{"line_number":483,"context_line":"                    # TCP4 or TCP6\". This includes completely legitimate"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f7c97a3_95273213","line":480,"updated":"2018-05-23 23:29:17.000000000","message":"+1","commit_id":"0b07417830767da71a3909f076c854d4954e8fcf"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"09bd2cc2886b313a64331a781c3b4894246c1839","unresolved":false,"context_lines":[{"line_number":538,"context_line":"    # necessary for the AWS SDK to work with swift3 middleware."},{"line_number":539,"context_line":"    argspec \u003d inspect.getargspec(wsgi.server)"},{"line_number":540,"context_line":"    if \u0027capitalize_response_headers\u0027 in argspec.args:"},{"line_number":541,"context_line":"        server_kwargs[\u0027capitalize_response_headers\u0027] \u003d False"},{"line_number":542,"context_line":"    try:"},{"line_number":543,"context_line":"        wsgi.server(sock, app, wsgi_logger, **server_kwargs)"},{"line_number":544,"context_line":"    except socket.error as err:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f7c97a3_b5390e40","line":541,"updated":"2018-05-23 23:29:17.000000000","message":"Off-topic: This option has been present since eventlet v0.15 -- how about we always plumb it through now?","commit_id":"0b07417830767da71a3909f076c854d4954e8fcf"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"58377a0bbf7b1d6531092d2be430ca586bfc3ba2","unresolved":false,"context_lines":[{"line_number":538,"context_line":"    # necessary for the AWS SDK to work with swift3 middleware."},{"line_number":539,"context_line":"    argspec \u003d inspect.getargspec(wsgi.server)"},{"line_number":540,"context_line":"    if \u0027capitalize_response_headers\u0027 in argspec.args:"},{"line_number":541,"context_line":"        server_kwargs[\u0027capitalize_response_headers\u0027] \u003d False"},{"line_number":542,"context_line":"    try:"},{"line_number":543,"context_line":"        wsgi.server(sock, app, wsgi_logger, **server_kwargs)"},{"line_number":544,"context_line":"    except socket.error as err:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f7c97a3_b8e103ff","line":541,"in_reply_to":"5f7c97a3_b5390e40","updated":"2018-05-24 01:10:47.000000000","message":"I can push a separate patch.","commit_id":"0b07417830767da71a3909f076c854d4954e8fcf"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"1ed2120c28f5a119279485ae57add462deef2853","unresolved":false,"context_lines":[{"line_number":437,"context_line":"        logger.error(\u0027ERROR WSGI: \u0027 + f, *a)"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"class SwiftHttpProxiedProtocol(SwiftHttpProtocol):"},{"line_number":441,"context_line":"    \"\"\""},{"line_number":442,"context_line":"    Protocol object that speaks HTTP, including multiple requests, but with"},{"line_number":443,"context_line":"    a single PROXY line as the very first thing coming in over the socket."}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_581534e4","line":440,"range":{"start_line":440,"start_character":15,"end_line":440,"end_character":22},"updated":"2018-05-25 20:01:50.000000000","message":"nit: I might\u0027ve gone with SwiftHttpProxyProtocol just for ease of searchability, but w/e","commit_id":"661838d968c163cec716cd5c8bcce9f5c69d18d4"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"1ed2120c28f5a119279485ae57add462deef2853","unresolved":false,"context_lines":[{"line_number":456,"context_line":"        # circumstances.  We always send the request into the superclass to"},{"line_number":457,"context_line":"        # handle any cleanup - this ensures that the request will not be"},{"line_number":458,"context_line":"        # processed."},{"line_number":459,"context_line":"        self.rfile.close()"},{"line_number":460,"context_line":"        # We don\u0027t really have any confidence that an HTTP Error will be"},{"line_number":461,"context_line":"        # processable by the client as our transmission broken down between"},{"line_number":462,"context_line":"        # ourselves and our gateway proxy before processing the client"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_b8a7a8bc","line":459,"updated":"2018-05-25 20:01:50.000000000","message":"Not covered in tests.\n\nI wonder if *this* would\u0027ve been a better approach for what I was trying to do in https://review.openstack.org/#/c/471993/ ?","commit_id":"661838d968c163cec716cd5c8bcce9f5c69d18d4"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"1ed2120c28f5a119279485ae57add462deef2853","unresolved":false,"context_lines":[{"line_number":462,"context_line":"        # ourselves and our gateway proxy before processing the client"},{"line_number":463,"context_line":"        # protocol request.  Hopefully the operator will know what to do!"},{"line_number":464,"context_line":"        msg \u003d \u0027Invalid PROXY line %r\u0027 % connection_line"},{"line_number":465,"context_line":"        self.log_message(msg)"},{"line_number":466,"context_line":"        # Even assuming HTTP we don\u0027t even known what version of HTTP the"},{"line_number":467,"context_line":"        # client is sending?  This entire endeavor seems questionable."},{"line_number":468,"context_line":"        self.request_version \u003d self.default_request_version"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_f88f6020","line":465,"updated":"2018-05-25 20:01:50.000000000","message":"Not covered in tests, but... eh? w/e","commit_id":"661838d968c163cec716cd5c8bcce9f5c69d18d4"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"1ed2120c28f5a119279485ae57add462deef2853","unresolved":false,"context_lines":[{"line_number":479,"context_line":""},{"line_number":480,"context_line":"        if connection_line.startswith(b\u0027PROXY\u0027):"},{"line_number":481,"context_line":"            proxy_parts \u003d connection_line.split(b\u0027 \u0027)"},{"line_number":482,"context_line":"            if len(proxy_parts) \u003e\u003d 2 and proxy_parts[0] \u003d\u003d b\u0027PROXY\u0027:"},{"line_number":483,"context_line":"                if proxy_parts[1] in (b\u0027TCP4\u0027, b\u0027TCP6\u0027) and \\"},{"line_number":484,"context_line":"                        len(proxy_parts) \u003d\u003d 6:"},{"line_number":485,"context_line":"                    if six.PY2:"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_b37a6b74","line":482,"updated":"2018-05-25 20:01:50.000000000","message":"We can nix this whole condition by checking for b\u0027PROXY \u0027 on L480.","commit_id":"661838d968c163cec716cd5c8bcce9f5c69d18d4"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"1ed2120c28f5a119279485ae57add462deef2853","unresolved":false,"context_lines":[{"line_number":504,"context_line":"        else:"},{"line_number":505,"context_line":"            self.handle_error(connection_line)"},{"line_number":506,"context_line":""},{"line_number":507,"context_line":"        return SwiftHttpProtocol.handle(self)"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":""},{"line_number":510,"context_line":"def run_server(conf, logger, sock, global_conf\u003dNone):"}],"source_content_type":"text/x-python","patch_set":11,"id":"5f7c97a3_53e0b726","line":507,"updated":"2018-05-25 20:01:50.000000000","message":"So even when we\u0027ve handled an error, we still call the parent class\u0027s handle... which goes into handle_one_request, tries to read a line from the now-closed rfile, sets\n\n self.close_connection \u003d 1\n\nand bails. *shrug* We already get that just from send_error, though: https://github.com/python/cpython/blob/v2.7/Lib/BaseHTTPServer.py#L367\n\nSide note: whee, old-style classes!","commit_id":"661838d968c163cec716cd5c8bcce9f5c69d18d4"}],"test/functional/__init__.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0721857b26668d3198a6493924d4bb2b9ca8c4a6","unresolved":false,"context_lines":[{"line_number":498,"context_line":"    eventlet.wsgi.HttpProtocol.default_request_version \u003d \"HTTP/1.0\""},{"line_number":499,"context_line":"    # Turn off logging requests by the underlying WSGI software."},{"line_number":500,"context_line":"    eventlet.wsgi.HttpProtocol.log_request \u003d lambda *a: None"},{"line_number":501,"context_line":"    logger \u003d utils.get_logger(config, \u0027wsgi-server\u0027, log_route\u003d\u0027wsgi\u0027)"},{"line_number":502,"context_line":"    # Redirect logging other messages by the underlying WSGI software."},{"line_number":503,"context_line":"    eventlet.wsgi.HttpProtocol.log_message \u003d \\"},{"line_number":504,"context_line":"        lambda s, f, *a: logger.error(\u0027ERROR WSGI: \u0027 + f % a)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_0108852c","side":"PARENT","line":501,"updated":"2016-09-21 05:23:08.000000000","message":"ah, so w/o show_debug_logs the proxy\u0027s logger was this guy - returned from the mock.patch\u0027d common.utils.get_logger","commit_id":"b4c1517ddd0d57f556721caf587c113e4abc0498"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"798a392961cb4f99306ef8c6b7142bac32eda5a4","unresolved":false,"context_lines":[{"line_number":498,"context_line":"    eventlet.wsgi.HttpProtocol.default_request_version \u003d \"HTTP/1.0\""},{"line_number":499,"context_line":"    # Turn off logging requests by the underlying WSGI software."},{"line_number":500,"context_line":"    eventlet.wsgi.HttpProtocol.log_request \u003d lambda *a: None"},{"line_number":501,"context_line":"    logger \u003d utils.get_logger(config, \u0027wsgi-server\u0027, log_route\u003d\u0027wsgi\u0027)"},{"line_number":502,"context_line":"    # Redirect logging other messages by the underlying WSGI software."},{"line_number":503,"context_line":"    eventlet.wsgi.HttpProtocol.log_message \u003d \\"},{"line_number":504,"context_line":"        lambda s, f, *a: logger.error(\u0027ERROR WSGI: \u0027 + f % a)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_5c67a4b6","side":"PARENT","line":501,"in_reply_to":"7a8ec9b2_0108852c","updated":"2016-09-21 15:48:09.000000000","message":"Without show_debug_logs, every \"logger name\" was None, including the proxy\u0027s.  But the proxy\u0027s None was convolutedly derived differently than the other daemons for no good reason that I could discern.\n\nThe logger here is only for the server wsgi logging, and was not causing me grief, afaik","commit_id":"b4c1517ddd0d57f556721caf587c113e4abc0498"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0721857b26668d3198a6493924d4bb2b9ca8c4a6","unresolved":false,"context_lines":[{"line_number":509,"context_line":"        if show_debug_logs:"},{"line_number":510,"context_line":"            return debug_logger(name)"},{"line_number":511,"context_line":"        else:"},{"line_number":512,"context_line":"            return None"},{"line_number":513,"context_line":""},{"line_number":514,"context_line":"    acc1srv \u003d account_server.AccountController("},{"line_number":515,"context_line":"        config, logger\u003dget_logger_name(\u0027acct1\u0027))"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_2fcacd6e","side":"PARENT","line":512,"updated":"2016-09-21 05:23:08.000000000","message":"apparently this None was giving Darrel some grief?","commit_id":"b4c1517ddd0d57f556721caf587c113e4abc0498"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"798a392961cb4f99306ef8c6b7142bac32eda5a4","unresolved":false,"context_lines":[{"line_number":509,"context_line":"        if show_debug_logs:"},{"line_number":510,"context_line":"            return debug_logger(name)"},{"line_number":511,"context_line":"        else:"},{"line_number":512,"context_line":"            return None"},{"line_number":513,"context_line":""},{"line_number":514,"context_line":"    acc1srv \u003d account_server.AccountController("},{"line_number":515,"context_line":"        config, logger\u003dget_logger_name(\u0027acct1\u0027))"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_1ce6fc14","side":"PARENT","line":512,"in_reply_to":"7a8ec9b2_2fcacd6e","updated":"2016-09-21 15:48:09.000000000","message":"ya, I explained verbally; w/o the env var to do debug logging, log methods would get called on None.","commit_id":"b4c1517ddd0d57f556721caf587c113e4abc0498"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0721857b26668d3198a6493924d4bb2b9ca8c4a6","unresolved":false,"context_lines":[{"line_number":512,"context_line":"            return None"},{"line_number":513,"context_line":""},{"line_number":514,"context_line":"    acc1srv \u003d account_server.AccountController("},{"line_number":515,"context_line":"        config, logger\u003dget_logger_name(\u0027acct1\u0027))"},{"line_number":516,"context_line":"    acc2srv \u003d account_server.AccountController("},{"line_number":517,"context_line":"        config, logger\u003dget_logger_name(\u0027acct2\u0027))"},{"line_number":518,"context_line":"    con1srv \u003d container_server.ContainerController("}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_4bee26b5","side":"PARENT","line":515,"updated":"2016-09-21 05:23:08.000000000","message":"The FakeLogger guy seems fine - but I think in-process func tests probably used to log to syslog when they got None here","commit_id":"b4c1517ddd0d57f556721caf587c113e4abc0498"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"798a392961cb4f99306ef8c6b7142bac32eda5a4","unresolved":false,"context_lines":[{"line_number":512,"context_line":"            return None"},{"line_number":513,"context_line":""},{"line_number":514,"context_line":"    acc1srv \u003d account_server.AccountController("},{"line_number":515,"context_line":"        config, logger\u003dget_logger_name(\u0027acct1\u0027))"},{"line_number":516,"context_line":"    acc2srv \u003d account_server.AccountController("},{"line_number":517,"context_line":"        config, logger\u003dget_logger_name(\u0027acct2\u0027))"},{"line_number":518,"context_line":"    con1srv \u003d container_server.ContainerController("}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_1c943c41","side":"PARENT","line":515,"in_reply_to":"7a8ec9b2_4bee26b5","updated":"2016-09-21 15:48:09.000000000","message":"really?  through what mechanism?  did something see a None, then construct some kind of logger that goes to syslog and then call log methods (like \"info\" or \"debug\") on taht new object?","commit_id":"b4c1517ddd0d57f556721caf587c113e4abc0498"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0721857b26668d3198a6493924d4bb2b9ca8c4a6","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        for index in range(len(obj_sockets))"},{"line_number":524,"context_line":"    ]"},{"line_number":525,"context_line":""},{"line_number":526,"context_line":"    logger \u003d get_logger_name(\u0027proxy\u0027)"},{"line_number":527,"context_line":""},{"line_number":528,"context_line":"    def get_logger(name, *args, **kwargs):"},{"line_number":529,"context_line":"        return logger"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_ab0c0a95","line":526,"updated":"2016-09-21 05:23:08.000000000","message":"I think I\u0027d probably rip out the FakeLogger guy and just add an else block here\n\n    else:\n        logger \u003d utils.get_logger(config, \u0027wsgi-server\u0027, log_route\u003d\u0027wsgi\u0027)\n\nI\u0027m not so super sure that\u0027s a bunch better that what you came up with - but I think it\u0027s more equivalent to what was here before.","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"798a392961cb4f99306ef8c6b7142bac32eda5a4","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        for index in range(len(obj_sockets))"},{"line_number":524,"context_line":"    ]"},{"line_number":525,"context_line":""},{"line_number":526,"context_line":"    logger \u003d get_logger_name(\u0027proxy\u0027)"},{"line_number":527,"context_line":""},{"line_number":528,"context_line":"    def get_logger(name, *args, **kwargs):"},{"line_number":529,"context_line":"        return logger"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_3cabb876","line":526,"in_reply_to":"7a8ec9b2_ab0c0a95","updated":"2016-09-21 15:48:09.000000000","message":"Is that what None was somehow accomplishing? where did that take place?","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0721857b26668d3198a6493924d4bb2b9ca8c4a6","unresolved":false,"context_lines":[{"line_number":551,"context_line":"                             protocol\u003dSwiftHttpProtocol)"},{"line_number":552,"context_line":""},{"line_number":553,"context_line":"    objspa \u003d [eventlet.spawn(eventlet.wsgi.server, objsrv[0], objsrv[1], nl,"},{"line_number":554,"context_line":"                             protocol\u003dSwiftHttpProtocol)"},{"line_number":555,"context_line":"              for objsrv in objsrvs]"},{"line_number":556,"context_line":""},{"line_number":557,"context_line":"    global _test_coros"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_8b7caeec","line":554,"updated":"2016-09-21 05:23:08.000000000","message":"this is great, seems like this would have been easy to miss/rust, nice grepping","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"24b3e47c17c727a846e9f45681b6753ac775e7f7","unresolved":false,"context_lines":[{"line_number":505,"context_line":"        else:"},{"line_number":506,"context_line":"            fake_logger \u003d FakeLogger()"},{"line_number":507,"context_line":"            fake_logger.name \u003d \u0027swift.func.%s\u0027 % name"},{"line_number":508,"context_line":"            return fake_logger"},{"line_number":509,"context_line":""},{"line_number":510,"context_line":"    acc1srv \u003d account_server.AccountController("},{"line_number":511,"context_line":"        config, logger\u003dget_logger_name(\u0027acct1\u0027))"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a8bc5a2_4f6830f6","line":508,"updated":"2016-09-22 18:51:47.000000000","message":"Before this change the inprocess func tests logged to syslog; with this change the default behavior is to not log at all - and if you turn on SWIFT_TEST_DEBUG_LOGS it\u0027s pretty noisy.\n\nI don\u0027t think the existing setup is good [1].  But I think this is worse.\n\nFow now; please consider keeping the existing (not great) behavior the same [2]\n\n1. I\u0027m working on a follow-up https://review.openstack.org/#/c/375056\n\n2. https://gist.github.com/clayg/ee265e11f8a309284574e64238c56648","commit_id":"a28c52e1434609ba2be3fbfe2f39f38b8bd3b47e"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"ea5f45ede994d761eb57ded33ad4b3e92d4b109c","unresolved":false,"context_lines":[{"line_number":505,"context_line":"        else:"},{"line_number":506,"context_line":"            fake_logger \u003d FakeLogger()"},{"line_number":507,"context_line":"            fake_logger.name \u003d \u0027swift.func.%s\u0027 % name"},{"line_number":508,"context_line":"            return fake_logger"},{"line_number":509,"context_line":""},{"line_number":510,"context_line":"    acc1srv \u003d account_server.AccountController("},{"line_number":511,"context_line":"        config, logger\u003dget_logger_name(\u0027acct1\u0027))"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a8bc5a2_982b5feb","line":508,"in_reply_to":"5a8bc5a2_4f6830f6","updated":"2016-09-22 20:06:01.000000000","message":"sure","commit_id":"a28c52e1434609ba2be3fbfe2f39f38b8bd3b47e"}],"test/unit/common/test_wsgi.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"ffdade825ac14b93c38b4d1753aa40d46d96b99b","unresolved":false,"context_lines":[{"line_number":622,"context_line":"        self.assertTrue(_wsgi.server.called)"},{"line_number":623,"context_line":"        args, kwargs \u003d _wsgi.server.call_args"},{"line_number":624,"context_line":"        self.assertEqual(kwargs.get(\u0027capitalize_response_headers\u0027), False)"},{"line_number":625,"context_line":"        self.assertTrue(\u0027protocol\u0027 in kwargs)"},{"line_number":626,"context_line":"        self.assertEqual(\u0027HTTP/1.0\u0027,"},{"line_number":627,"context_line":"                         kwargs[\u0027protocol\u0027].default_request_version)"},{"line_number":628,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_6f02150d","line":625,"updated":"2016-09-21 01:07:17.000000000","message":"Might be nicer to use\n\n self.assertIn(\u0027protocol\u0027, kwargs)\n\nDitto below.","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"798a392961cb4f99306ef8c6b7142bac32eda5a4","unresolved":false,"context_lines":[{"line_number":622,"context_line":"        self.assertTrue(_wsgi.server.called)"},{"line_number":623,"context_line":"        args, kwargs \u003d _wsgi.server.call_args"},{"line_number":624,"context_line":"        self.assertEqual(kwargs.get(\u0027capitalize_response_headers\u0027), False)"},{"line_number":625,"context_line":"        self.assertTrue(\u0027protocol\u0027 in kwargs)"},{"line_number":626,"context_line":"        self.assertEqual(\u0027HTTP/1.0\u0027,"},{"line_number":627,"context_line":"                         kwargs[\u0027protocol\u0027].default_request_version)"},{"line_number":628,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_dc001469","line":625,"in_reply_to":"7a8ec9b2_6f02150d","updated":"2016-09-21 15:48:09.000000000","message":"ya, followed convention of existing tests (consistency over fixing all of them to be different and consistent)","commit_id":"23ec536d073b3fee575447f44066816205d8f858"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4f564fae0eadaec50f13e9c16a89204fef279d21","unresolved":false,"context_lines":[{"line_number":503,"context_line":"        # If the app somehow had no logger attribute or it was None, don\u0027t blow"},{"line_number":504,"context_line":"        # up"},{"line_number":505,"context_line":"        proto_obj \u003d self._proto_obj()"},{"line_number":506,"context_line":"        proto_obj.server \u003d Namespace(app\u003dNamespace())"},{"line_number":507,"context_line":""},{"line_number":508,"context_line":"        proto_obj.log_message(\u0027a%sc\u0027, \u0027b\u0027)"},{"line_number":509,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5a8bc5a2_de6f9890","line":506,"updated":"2016-09-22 18:27:40.000000000","message":"We can\u0027t just use a Mock()? Like\n\n proto_obj.server \u003d mock.Mock(app\u003dmock.Mock(spec\u003d[]))","commit_id":"a28c52e1434609ba2be3fbfe2f39f38b8bd3b47e"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"24b3e47c17c727a846e9f45681b6753ac775e7f7","unresolved":false,"context_lines":[{"line_number":503,"context_line":"        # If the app somehow had no logger attribute or it was None, don\u0027t blow"},{"line_number":504,"context_line":"        # up"},{"line_number":505,"context_line":"        proto_obj \u003d self._proto_obj()"},{"line_number":506,"context_line":"        proto_obj.server \u003d Namespace(app\u003dNamespace())"},{"line_number":507,"context_line":""},{"line_number":508,"context_line":"        proto_obj.log_message(\u0027a%sc\u0027, \u0027b\u0027)"},{"line_number":509,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5a8bc5a2_afdd3472","line":506,"in_reply_to":"5a8bc5a2_de6f9890","updated":"2016-09-22 18:51:47.000000000","message":"i kinda think the Namespace trick is cute - no question of extra magic attrs here!","commit_id":"a28c52e1434609ba2be3fbfe2f39f38b8bd3b47e"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"762a38273bc7e14a95c404033a2c118aba82dcb8","unresolved":false,"context_lines":[{"line_number":521,"context_line":""},{"line_number":522,"context_line":"        proto_obj.server.app.logger \u003d None"},{"line_number":523,"context_line":""},{"line_number":524,"context_line":"        proto_obj.log_message(\u0027a%sc\u0027, \u0027b\u0027)"},{"line_number":525,"context_line":""},{"line_number":526,"context_line":"    def test_swift_http_protocol_parse_request_no_proxy(self):"},{"line_number":527,"context_line":"        proto_obj \u003d self._proto_obj()"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_82368101","line":524,"updated":"2016-09-23 02:07:50.000000000","message":"if you \"fix\" the thing where we default to logging *somewhere* these tests will have to change a little bit I think\n\nhttps://gist.github.com/clayg/6306d4b55c7ca66efb650b589db5ead0\n\nI know with in-process functests you observed the mock.patche\u0027d get_logger return None for the proxy\u0027s log object - but I think that was an artifact of the other change you already fixed.  Sorry.","commit_id":"dd13cc7ea9fb0da1d9f7a783fcfbc2fb4aeff752"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"762a38273bc7e14a95c404033a2c118aba82dcb8","unresolved":false,"context_lines":[{"line_number":616,"context_line":"            self.assertEqual((\u0027a\u0027, \u0027123\u0027), proto_obj.client_address)"},{"line_number":617,"context_line":"            self.assertEqual(\u0027HTTP next line\u0027, proto_obj.raw_requestline)"},{"line_number":618,"context_line":"            self.assertEqual([mock.call.readline(777)],"},{"line_number":619,"context_line":"                             proto_obj.rfile.mock_calls)"},{"line_number":620,"context_line":""},{"line_number":621,"context_line":"    def test_run_server_with_latest_eventlet(self):"},{"line_number":622,"context_line":"        config \u003d \"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_c2408959","line":619,"updated":"2016-09-23 02:07:50.000000000","message":"these tests are great - did I already say that?","commit_id":"dd13cc7ea9fb0da1d9f7a783fcfbc2fb4aeff752"}]}
