)]}'
{"glance/api/middleware/uwsgi_dechunk.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"7bca8322ac1865c57e7888663d520c312d777221","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"try:"},{"line_number":24,"context_line":"    import uwsgi"},{"line_number":25,"context_line":"    LOG.info(\"Detected running under uwsgi\")"},{"line_number":26,"context_line":"except ImportError:"},{"line_number":27,"context_line":"    LOG.info(\"Detected not running under uwsgi\")"},{"line_number":28,"context_line":"    uwsgi \u003d None"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_28d5ba1c","line":25,"updated":"2017-08-11 22:22:40.000000000","message":"This isn\u0027t safe unless we\u0027re in a virtualenv. Just because we can import doesn\u0027t mean it is being used. There ought to be something in the wsgi environ that you can use to check for the presence of uwsgi. I\u0027ll look on monday if you don\u0027t get a chance.","commit_id":"a6351b5302e64a124fd667e30cad18103d616db1"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"0ca401f299586aa2cf5c0466532a47808015efb2","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"try:"},{"line_number":24,"context_line":"    import uwsgi"},{"line_number":25,"context_line":"    LOG.info(\"Detected running under uwsgi\")"},{"line_number":26,"context_line":"except ImportError:"},{"line_number":27,"context_line":"    LOG.info(\"Detected not running under uwsgi\")"},{"line_number":28,"context_line":"    uwsgi \u003d None"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_9ab96816","line":25,"in_reply_to":"9f436f4f_28d5ba1c","updated":"2017-08-14 16:44:31.000000000","message":"This actually should be safe. The uwsgi module is only available if the code is running under the uwsgi server. [1] I did some quick testing and wasn\u0027t able to import uwsgi unless I was running under the server.\n\n[1] http://uwsgi-docs.readthedocs.io/en/latest/PythonModule.html#the-uwsgi-python-module","commit_id":"a6351b5302e64a124fd667e30cad18103d616db1"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"f5fbffaa424bc767e0949aa76420f73667056047","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"try:"},{"line_number":24,"context_line":"    import uwsgi"},{"line_number":25,"context_line":"    LOG.info(\"Detected running under uwsgi\")"},{"line_number":26,"context_line":"except ImportError:"},{"line_number":27,"context_line":"    LOG.info(\"Detected not running under uwsgi\")"},{"line_number":28,"context_line":"    uwsgi \u003d None"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_ba6aec7d","line":25,"in_reply_to":"9f436f4f_9ab96816","updated":"2017-08-14 16:46:02.000000000","message":"Wacky, I guess with great power comes great responsibility.","commit_id":"a6351b5302e64a124fd667e30cad18103d616db1"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"7bca8322ac1865c57e7888663d520c312d777221","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    def process_request(self, req):"},{"line_number":46,"context_line":"        if uwsgi:"},{"line_number":47,"context_line":"            if req.headers.get(\u0027Transfer-Encoding\u0027) \u003d\u003d \u0027chunked\u0027:"},{"line_number":48,"context_line":"                req.body \u003d self._dechunk()"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_8893865b","line":48,"updated":"2017-08-11 22:22:40.000000000","message":"As you\u0027ve noted this can use a huge amount of memory and I reckon that would be a pretty bad idea, especially at scale.\n\nIt might be possible to associate req.body_file with an iterator over uwsgi.chunked_read()\n\nAgain, whether that works or not depends on where/how the body is being read in glance.","commit_id":"a6351b5302e64a124fd667e30cad18103d616db1"}]}
