)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"a685d955d5869f8c88501dfc207e1c12d50bf6fd","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"improving error handling in chunked upload"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Keep traceback of chucked upload in a variable and raise it after"},{"line_number":10,"context_line":"deleting orphaned data to avoid covering sys.exc_info()."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"fixed bug #1185609"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAAP3%2F%2F5o0%3D","line":9,"updated":"2013-07-09 15:04:51.000000000","message":"s/chucked/chunked/","commit_id":"5f7054024cce5a10ef98795872407396ee19bcea"}],"glance/store/swift.py":[{"author":{"_account_id":7780,"name":"Jared Culp","email":"jared.culp@rackspace.com","username":"jaredculp"},"change_message_id":"4db0bcfc6773fd3326a1c9fa9917bc29ded0797c","unresolved":false,"context_lines":[{"line_number":376,"context_line":"                        written_chunks.append(chunk_name)"},{"line_number":377,"context_line":"                    except Exception:"},{"line_number":378,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":379,"context_line":"                        LOG.error(\"Errors in chucked upload!\")"},{"line_number":380,"context_line":"                        err \u003d sys.exc_info()"},{"line_number":381,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":382,"context_line":"                                                  location.container,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAP3%2F%2F5q0%3D","line":379,"updated":"2013-07-09 14:56:26.000000000","message":"We want to capture why this error is occurring so that we get some insight into why this is happening, rather than logging a generic message.","commit_id":"5f7054024cce5a10ef98795872407396ee19bcea"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"a685d955d5869f8c88501dfc207e1c12d50bf6fd","unresolved":false,"context_lines":[{"line_number":376,"context_line":"                        written_chunks.append(chunk_name)"},{"line_number":377,"context_line":"                    except Exception:"},{"line_number":378,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":379,"context_line":"                        LOG.error(\"Errors in chucked upload!\")"},{"line_number":380,"context_line":"                        err \u003d sys.exc_info()"},{"line_number":381,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":382,"context_line":"                                                  location.container,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAP3%2F%2F5pg%3D","line":379,"updated":"2013-07-09 15:04:51.000000000","message":"s/chucked/chunked/","commit_id":"5f7054024cce5a10ef98795872407396ee19bcea"},{"author":{"_account_id":6835,"name":"Kun Huang","email":"gareth@openstacker.org","username":"academicgareth"},"change_message_id":"409b1c93749ea4bf79bb645f80abde15f771b4b0","unresolved":false,"context_lines":[{"line_number":376,"context_line":"                        written_chunks.append(chunk_name)"},{"line_number":377,"context_line":"                    except Exception:"},{"line_number":378,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":379,"context_line":"                        LOG.error(\"Errors in chucked upload!\")"},{"line_number":380,"context_line":"                        err \u003d sys.exc_info()"},{"line_number":381,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":382,"context_line":"                                                  location.container,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAP3%2F%2F5Tw%3D","line":379,"in_reply_to":"AAAAP3%2F%2F5pg%3D","updated":"2013-07-09 16:31:00.000000000","message":"Done","commit_id":"5f7054024cce5a10ef98795872407396ee19bcea"},{"author":{"_account_id":6835,"name":"Kun Huang","email":"gareth@openstacker.org","username":"academicgareth"},"change_message_id":"409b1c93749ea4bf79bb645f80abde15f771b4b0","unresolved":false,"context_lines":[{"line_number":376,"context_line":"                        written_chunks.append(chunk_name)"},{"line_number":377,"context_line":"                    except Exception:"},{"line_number":378,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":379,"context_line":"                        LOG.error(\"Errors in chucked upload!\")"},{"line_number":380,"context_line":"                        err \u003d sys.exc_info()"},{"line_number":381,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":382,"context_line":"                                                  location.container,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAP3%2F%2F5TU%3D","line":379,"in_reply_to":"AAAAP3%2F%2F5q0%3D","updated":"2013-07-09 16:31:00.000000000","message":"Let me put trackback msg into this log. I think that is enough to explain why error occurred.","commit_id":"5f7054024cce5a10ef98795872407396ee19bcea"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"e53db31fa57749aa3c12262c7adf6b50029496e0","unresolved":false,"context_lines":[{"line_number":377,"context_line":"                    except Exception:"},{"line_number":378,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":379,"context_line":"                        LOG.error(\"Errors in chucked upload!\")"},{"line_number":380,"context_line":"                        err \u003d sys.exc_info()"},{"line_number":381,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":382,"context_line":"                                                  location.container,"},{"line_number":383,"context_line":"                                                  written_chunks)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAP3%2F%2F6xo%3D","line":380,"updated":"2013-07-09 07:52:21.000000000","message":"I think, this variable do not required here. AFAIK\n\n\nexcept:\n   ...\n   raise\n\nshould re raise last exception","commit_id":"5f7054024cce5a10ef98795872407396ee19bcea"},{"author":{"_account_id":7491,"name":"Viktor Serhieiev","email":"viktor.sergeyev@gmail.com","username":"vsergeyev"},"change_message_id":"4ccadd81fee5de7d1068166c18200eb8b496d956","unresolved":false,"context_lines":[{"line_number":377,"context_line":"                    except Exception:"},{"line_number":378,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":379,"context_line":"                        LOG.error(\"Errors in chucked upload!\")"},{"line_number":380,"context_line":"                        err \u003d sys.exc_info()"},{"line_number":381,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":382,"context_line":"                                                  location.container,"},{"line_number":383,"context_line":"                                                  written_chunks)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAP3%2F%2F6u0%3D","line":380,"in_reply_to":"AAAAP3%2F%2F6wA%3D","updated":"2013-07-09 08:10:53.000000000","message":"oh... Yes, you\u0027re right.","commit_id":"5f7054024cce5a10ef98795872407396ee19bcea"},{"author":{"_account_id":6835,"name":"Kun Huang","email":"gareth@openstacker.org","username":"academicgareth"},"change_message_id":"767ac22be08a101eafa59c23a8e5eb6988b478f8","unresolved":false,"context_lines":[{"line_number":377,"context_line":"                    except Exception:"},{"line_number":378,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":379,"context_line":"                        LOG.error(\"Errors in chucked upload!\")"},{"line_number":380,"context_line":"                        err \u003d sys.exc_info()"},{"line_number":381,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":382,"context_line":"                                                  location.container,"},{"line_number":383,"context_line":"                                                  written_chunks)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAP3%2F%2F6wA%3D","line":380,"in_reply_to":"AAAAP3%2F%2F6xo%3D","updated":"2013-07-09 07:59:48.000000000","message":"but traceback of exception in connection.put_object will be covered by exception in self._delete_stale_chunks\n\nlook this https://bugs.launchpad.net/glance/+bug/1199125\nand this easy sample: https://gist.github.com/pyKun/5954607","commit_id":"5f7054024cce5a10ef98795872407396ee19bcea"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"0d839cca2edcecad03ae4067e83440c8dab06113","unresolved":false,"context_lines":[{"line_number":381,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":382,"context_line":"                                                  location.container,"},{"line_number":383,"context_line":"                                                  written_chunks)"},{"line_number":384,"context_line":"                        raise err[0], err[1], err[2]"},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"                    bytes_read \u003d reader.bytes_read"},{"line_number":387,"context_line":"                    msg \u003d _(\"Wrote chunk %(chunk_name)s (%(chunk_id)d/\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAP3%2F%2F5YY%3D","line":384,"updated":"2013-07-09 16:03:32.000000000","message":"How about update it as below to address Jared\u0027s concern?\n\nheader, loc, info \u003d sys.exc_info()\n\nLOG.error(\"Errors in chucked upload, because %s\" % info)\n\nraise header, loc, info","commit_id":"5f7054024cce5a10ef98795872407396ee19bcea"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"a685d955d5869f8c88501dfc207e1c12d50bf6fd","unresolved":false,"context_lines":[{"line_number":381,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":382,"context_line":"                                                  location.container,"},{"line_number":383,"context_line":"                                                  written_chunks)"},{"line_number":384,"context_line":"                        raise err[0], err[1], err[2]"},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"                    bytes_read \u003d reader.bytes_read"},{"line_number":387,"context_line":"                    msg \u003d _(\"Wrote chunk %(chunk_name)s (%(chunk_id)d/\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAP3%2F%2F5o8%3D","line":384,"updated":"2013-07-09 15:04:51.000000000","message":"I may be wrong here, but this style of traceback handling doesn\u0027t seem common throughout the rest of the code.\n\nWould:\n\nLOG.exception(\"Errors in chunked upload!\")\n\nabove will get the result we want?","commit_id":"5f7054024cce5a10ef98795872407396ee19bcea"},{"author":{"_account_id":6835,"name":"Kun Huang","email":"gareth@openstacker.org","username":"academicgareth"},"change_message_id":"409b1c93749ea4bf79bb645f80abde15f771b4b0","unresolved":false,"context_lines":[{"line_number":381,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":382,"context_line":"                                                  location.container,"},{"line_number":383,"context_line":"                                                  written_chunks)"},{"line_number":384,"context_line":"                        raise err[0], err[1], err[2]"},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"                    bytes_read \u003d reader.bytes_read"},{"line_number":387,"context_line":"                    msg \u003d _(\"Wrote chunk %(chunk_name)s (%(chunk_id)d/\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAP3%2F%2F5S4%3D","line":384,"in_reply_to":"AAAAP3%2F%2F5YY%3D","updated":"2013-07-09 16:31:00.000000000","message":"thx, specified var name is much better\nbut I think (type, value, traceback) is better","commit_id":"5f7054024cce5a10ef98795872407396ee19bcea"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"65aff86af76f9931b9bbf098bca11bddca0e8a10","unresolved":false,"context_lines":[{"line_number":379,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":380,"context_line":"                        err_type, err, tb \u003d sys.exc_info()"},{"line_number":381,"context_line":"                        LOG.error(\"Errors in chunked upload: %s\" %"},{"line_number":382,"context_line":"                                  traceback.format_exc(tb))"},{"line_number":383,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":384,"context_line":"                                                  location.container,"},{"line_number":385,"context_line":"                                                  written_chunks)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAP3%2F%2F5I4%3D","line":382,"updated":"2013-07-09 17:05:04.000000000","message":"Not saying there\u0027s a problem with this per se, but I still think LOG.exception and a raise below will accomplish the same task and be more consistent with the rest of the code.","commit_id":"1d1105b8b47c8c98c127ec64339743e29d6995d3"},{"author":{"_account_id":6835,"name":"Kun Huang","email":"gareth@openstacker.org","username":"academicgareth"},"change_message_id":"9236fe378f2931b5367ab5a1fb37048b7f093ff3","unresolved":false,"context_lines":[{"line_number":379,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":380,"context_line":"                        err_type, err, tb \u003d sys.exc_info()"},{"line_number":381,"context_line":"                        LOG.error(\"Errors in chunked upload: %s\" %"},{"line_number":382,"context_line":"                                  traceback.format_exc(tb))"},{"line_number":383,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":384,"context_line":"                                                  location.container,"},{"line_number":385,"context_line":"                                                  written_chunks)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAP3%2F%2F5GY%3D","line":382,"in_reply_to":"AAAAP3%2F%2F5I4%3D","updated":"2013-07-09 17:11:39.000000000","message":"I know this, but I think the msg in line 386 will be stderr of process, and line 381 could ensure this msg would be handled by syslog.\nIMO","commit_id":"1d1105b8b47c8c98c127ec64339743e29d6995d3"},{"author":{"_account_id":4463,"name":"iccha-sethi","email":"iccha.sethi@rackspace.com","username":"iccha-sethi"},"change_message_id":"bf60e58a0e4cd448e719b0455bea1e0cb78b7f08","unresolved":false,"context_lines":[{"line_number":383,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":384,"context_line":"                                                  location.container,"},{"line_number":385,"context_line":"                                                  written_chunks)"},{"line_number":386,"context_line":"                        raise err_type, err, tb"},{"line_number":387,"context_line":""},{"line_number":388,"context_line":"                    bytes_read \u003d reader.bytes_read"},{"line_number":389,"context_line":"                    msg \u003d _(\"Wrote chunk %(chunk_name)s (%(chunk_id)d/\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAP3%2F%2Ffgs%3D","line":386,"updated":"2013-07-17 13:33:51.000000000","message":"I am ok with the logging but I dont get why we cant leave it as just raise here. And also i think there is a patch in swiftclient to improve logging which will help \nhttps://review.openstack.org/37336","commit_id":"1d1105b8b47c8c98c127ec64339743e29d6995d3"},{"author":{"_account_id":6835,"name":"Kun Huang","email":"gareth@openstacker.org","username":"academicgareth"},"change_message_id":"fc8e130e509990f90e53f8e7ceae18d8b2d201ed","unresolved":false,"context_lines":[{"line_number":383,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":384,"context_line":"                                                  location.container,"},{"line_number":385,"context_line":"                                                  written_chunks)"},{"line_number":386,"context_line":"                        raise err_type, err, tb"},{"line_number":387,"context_line":""},{"line_number":388,"context_line":"                    bytes_read \u003d reader.bytes_read"},{"line_number":389,"context_line":"                    msg \u003d _(\"Wrote chunk %(chunk_name)s (%(chunk_id)d/\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAP3%2F%2FfJo%3D","line":386,"in_reply_to":"AAAAP3%2F%2FfNs%3D","updated":"2013-07-17 14:54:43.000000000","message":"no I don\u0027t think so.\n\nLet me leave just a \u0027raise\u0027 here","commit_id":"1d1105b8b47c8c98c127ec64339743e29d6995d3"},{"author":{"_account_id":4463,"name":"iccha-sethi","email":"iccha.sethi@rackspace.com","username":"iccha-sethi"},"change_message_id":"a075869c39588454f66f4aa02ac431e2d692e0da","unresolved":false,"context_lines":[{"line_number":383,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":384,"context_line":"                                                  location.container,"},{"line_number":385,"context_line":"                                                  written_chunks)"},{"line_number":386,"context_line":"                        raise err_type, err, tb"},{"line_number":387,"context_line":""},{"line_number":388,"context_line":"                    bytes_read \u003d reader.bytes_read"},{"line_number":389,"context_line":"                    msg \u003d _(\"Wrote chunk %(chunk_name)s (%(chunk_id)d/\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAP3%2F%2FfNs%3D","line":386,"in_reply_to":"AAAAP3%2F%2FfYM%3D","updated":"2013-07-17 14:40:50.000000000","message":"So this exceptuon is caught in glance/api/v1/upload_utils.py and raised as a 500. do u think it will utilize this traceback there?","commit_id":"1d1105b8b47c8c98c127ec64339743e29d6995d3"},{"author":{"_account_id":6835,"name":"Kun Huang","email":"gareth@openstacker.org","username":"academicgareth"},"change_message_id":"c8bf66765fd43f89cacdf23c3729fe68ee456bf6","unresolved":false,"context_lines":[{"line_number":383,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":384,"context_line":"                                                  location.container,"},{"line_number":385,"context_line":"                                                  written_chunks)"},{"line_number":386,"context_line":"                        raise err_type, err, tb"},{"line_number":387,"context_line":""},{"line_number":388,"context_line":"                    bytes_read \u003d reader.bytes_read"},{"line_number":389,"context_line":"                    msg \u003d _(\"Wrote chunk %(chunk_name)s (%(chunk_id)d/\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAP3%2F%2FfYM%3D","line":386,"in_reply_to":"AAAAP3%2F%2FfZk%3D","updated":"2013-07-17 14:03:02.000000000","message":"typo: I\u0027m not so sure .....","commit_id":"1d1105b8b47c8c98c127ec64339743e29d6995d3"},{"author":{"_account_id":6835,"name":"Kun Huang","email":"gareth@openstacker.org","username":"academicgareth"},"change_message_id":"6fe388ab1e12489aa4b539709cc1d9e70efa842b","unresolved":false,"context_lines":[{"line_number":383,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":384,"context_line":"                                                  location.container,"},{"line_number":385,"context_line":"                                                  written_chunks)"},{"line_number":386,"context_line":"                        raise err_type, err, tb"},{"line_number":387,"context_line":""},{"line_number":388,"context_line":"                    bytes_read \u003d reader.bytes_read"},{"line_number":389,"context_line":"                    msg \u003d _(\"Wrote chunk %(chunk_name)s (%(chunk_id)d/\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAP3%2F%2FfZk%3D","line":386,"in_reply_to":"AAAAP3%2F%2Ffgs%3D","updated":"2013-07-17 14:00:01.000000000","message":"I have not so sure for the \u0027raise\u0027 line. But logger.exception in that example just log msg not traceback, Jared need traceback.\n\nBTW, is removing raise line ok? error in chunked upload is well logged and self._delete_stale_chunks is self well logged I think","commit_id":"1d1105b8b47c8c98c127ec64339743e29d6995d3"},{"author":{"_account_id":4463,"name":"iccha-sethi","email":"iccha.sethi@rackspace.com","username":"iccha-sethi"},"change_message_id":"68328640b923d34aafefe9574df1b671a7c9f224","unresolved":false,"context_lines":[{"line_number":378,"context_line":"                    except Exception:"},{"line_number":379,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":380,"context_line":"                        tb \u003d sys.exc_info()[2]"},{"line_number":381,"context_line":"                        LOG.error(\"Errors in chunked upload: %s\" %"},{"line_number":382,"context_line":"                                  traceback.format_exc(tb))"},{"line_number":383,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":384,"context_line":"                                                  location.container,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAP3%2F%2FfAE%3D","line":381,"updated":"2013-07-17 15:35:13.000000000","message":"is a traceback always returned? what happens when a traceback is not returned? is that possible?\n\nSorry for all the questions :( Just trying to get a better understanding","commit_id":"3f45457ea73b1c0d2147cc1e660e9e0c2ea54635"},{"author":{"_account_id":6835,"name":"Kun Huang","email":"gareth@openstacker.org","username":"academicgareth"},"change_message_id":"f009c22d8eaa712809ecc9f5d756c1700d47282f","unresolved":false,"context_lines":[{"line_number":378,"context_line":"                    except Exception:"},{"line_number":379,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":380,"context_line":"                        tb \u003d sys.exc_info()[2]"},{"line_number":381,"context_line":"                        LOG.error(\"Errors in chunked upload: %s\" %"},{"line_number":382,"context_line":"                                  traceback.format_exc(tb))"},{"line_number":383,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":384,"context_line":"                                                  location.container,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAP3%2F%2Fe%2Fo%3D","line":381,"in_reply_to":"AAAAP3%2F%2FfAE%3D","updated":"2013-07-17 15:37:36.000000000","message":"http://docs.python.org/2/library/sys.html#sys.exc_info\n\nYes it always returned","commit_id":"3f45457ea73b1c0d2147cc1e660e9e0c2ea54635"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"b1284d3195ac278370acaa0575e59e50486dea67","unresolved":false,"context_lines":[{"line_number":379,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":380,"context_line":"                        tb \u003d sys.exc_info()[2]"},{"line_number":381,"context_line":"                        LOG.error(\"Errors in chunked upload: %s\" %"},{"line_number":382,"context_line":"                                  traceback.format_exc(tb))"},{"line_number":383,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":384,"context_line":"                                                  location.container,"},{"line_number":385,"context_line":"                                                  written_chunks)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAP3%2F%2Fe9w%3D","line":382,"updated":"2013-07-17 15:46:01.000000000","message":"Would you mind explaining again why this approach is better than LOG.exception() ?  You had mentioned something about syslog however I didn\u0027t fully understand","commit_id":"3f45457ea73b1c0d2147cc1e660e9e0c2ea54635"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"f7e2a9881a1fe4fa8493969e345616876d7201a1","unresolved":false,"context_lines":[{"line_number":379,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":380,"context_line":"                        tb \u003d sys.exc_info()[2]"},{"line_number":381,"context_line":"                        LOG.error(\"Errors in chunked upload: %s\" %"},{"line_number":382,"context_line":"                                  traceback.format_exc(tb))"},{"line_number":383,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":384,"context_line":"                                                  location.container,"},{"line_number":385,"context_line":"                                                  written_chunks)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAP3%2F%2Fexo%3D","line":382,"in_reply_to":"AAAAP3%2F%2Fe8Y%3D","updated":"2013-07-17 16:18:58.000000000","message":"I think you might be wrong regarding log.exception()...  I believe it is equivalent if not superior to traceback.format_exc()  \n\nCheck out the following code, it uses standard python logging rather than oslo but the functionality is the same: http://paste.openstack.org/show/40699/\n\nAll output from calls to LOG should go into syslog if use_syslog \u003d True in glance-api.conf","commit_id":"3f45457ea73b1c0d2147cc1e660e9e0c2ea54635"},{"author":{"_account_id":6835,"name":"Kun Huang","email":"gareth@openstacker.org","username":"academicgareth"},"change_message_id":"0342a10d79442669a367d4c6c6cd75052eea0758","unresolved":false,"context_lines":[{"line_number":379,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":380,"context_line":"                        tb \u003d sys.exc_info()[2]"},{"line_number":381,"context_line":"                        LOG.error(\"Errors in chunked upload: %s\" %"},{"line_number":382,"context_line":"                                  traceback.format_exc(tb))"},{"line_number":383,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":384,"context_line":"                                                  location.container,"},{"line_number":385,"context_line":"                                                  written_chunks)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAP3%2F%2Fe8Y%3D","line":382,"in_reply_to":"AAAAP3%2F%2Fe9w%3D","updated":"2013-07-17 16:04:02.000000000","message":"log.exception(e) # e is ValueError(\u0027hi, there is an error value\u0027)\nis same as log.exception(\u0027hi, there is an error value\u0027)\nbut what we could do better here is log.exception(\u0027value error %s\u0027 % traceback)\nand you\u0027ll see that in log\n    xxxx.file line 555\n    float(\u0027ddd\u0027)\nwhich is much helpful for debugging. So log.exception(traceback) is better than log.exception(e) \n\n\nSyslog is another thing. What we finally is all error details are in log system like syslog, not let it be printed as STDERR on your screen. So putting traceback into a string and using python logger to log it is a good way to record it into log system, like syslog.","commit_id":"3f45457ea73b1c0d2147cc1e660e9e0c2ea54635"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"e3c35def9ffa07f7eed8c453d4d17d83fd16ea6c","unresolved":false,"context_lines":[{"line_number":379,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":380,"context_line":"                        tb \u003d sys.exc_info()[2]"},{"line_number":381,"context_line":"                        LOG.error(\"Errors in chunked upload: %s\" %"},{"line_number":382,"context_line":"                                  traceback.format_exc(tb))"},{"line_number":383,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":384,"context_line":"                                                  location.container,"},{"line_number":385,"context_line":"                                                  written_chunks)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAP3%2F%2FeqM%3D","line":382,"in_reply_to":"AAAAP3%2F%2FerI%3D","updated":"2013-07-17 16:39:56.000000000","message":":)","commit_id":"3f45457ea73b1c0d2147cc1e660e9e0c2ea54635"},{"author":{"_account_id":6835,"name":"Kun Huang","email":"gareth@openstacker.org","username":"academicgareth"},"change_message_id":"2ff31099af827bba8c183645a40bb75882e3cb5b","unresolved":false,"context_lines":[{"line_number":379,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":380,"context_line":"                        tb \u003d sys.exc_info()[2]"},{"line_number":381,"context_line":"                        LOG.error(\"Errors in chunked upload: %s\" %"},{"line_number":382,"context_line":"                                  traceback.format_exc(tb))"},{"line_number":383,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":384,"context_line":"                                                  location.container,"},{"line_number":385,"context_line":"                                                  written_chunks)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAP3%2F%2FerI%3D","line":382,"in_reply_to":"AAAAP3%2F%2Fexo%3D","updated":"2013-07-17 16:37:27.000000000","message":"You are right Paul! Thanks for pointing out this.\n\nI just read python docs, but not have a real test. Actually logging.exception is more wonderful! thx","commit_id":"3f45457ea73b1c0d2147cc1e660e9e0c2ea54635"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"b9c085a43e8148308245b4c67b1ddd312be9b407","unresolved":false,"context_lines":[{"line_number":375,"context_line":"                        written_chunks.append(chunk_name)"},{"line_number":376,"context_line":"                    except Exception as e:"},{"line_number":377,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":378,"context_line":"                        LOG.exception(e)"},{"line_number":379,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":380,"context_line":"                                                  location.container,"},{"line_number":381,"context_line":"                                                  written_chunks)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2Femk%3D","line":378,"updated":"2013-07-17 16:50:50.000000000","message":"One more suggestion is, having a traceback is good, but a traceback + human readable explanation is even better.\n\nSo we can do something like:\n\nLOG.exception(_(\"Unexpected exception during chunked upload to backend, deleting stale chunks))\n\nAs long as this is within the scope the except: block, the traceback will be logged automatically.","commit_id":"157d82db1a65c161ed8af5519549a83444272d18"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"c67627dbb838f416e3dc2cc3d28d47fac3014542","unresolved":false,"context_lines":[{"line_number":373,"context_line":"                            location.container, chunk_name, reader,"},{"line_number":374,"context_line":"                            content_length\u003dcontent_length)"},{"line_number":375,"context_line":"                        written_chunks.append(chunk_name)"},{"line_number":376,"context_line":"                    except Exception as e:"},{"line_number":377,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":378,"context_line":"                        LOG.exception(_(\"Error during chunked upload to \"\\"},{"line_number":379,"context_line":"                                        \"backend, deleting stale chunks\"))"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAP3%2F%2Febs%3D","line":376,"updated":"2013-07-17 17:28:46.000000000","message":"We don\u0027t need to change this line now","commit_id":"f3090af2d80d6f38a36ae38ca6d01e9c278cb91b"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"c67627dbb838f416e3dc2cc3d28d47fac3014542","unresolved":false,"context_lines":[{"line_number":375,"context_line":"                        written_chunks.append(chunk_name)"},{"line_number":376,"context_line":"                    except Exception as e:"},{"line_number":377,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":378,"context_line":"                        LOG.exception(_(\"Error during chunked upload to \"\\"},{"line_number":379,"context_line":"                                        \"backend, deleting stale chunks\"))"},{"line_number":380,"context_line":"                        self._delete_stale_chunks(connection,"},{"line_number":381,"context_line":"                                                  location.container,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAP3%2F%2Febc%3D","line":378,"updated":"2013-07-17 17:28:46.000000000","message":"Dont need the \\ at the end of the line","commit_id":"f3090af2d80d6f38a36ae38ca6d01e9c278cb91b"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"46c72bf7c135ab06f355e7b91ae2097a5a3dc945","unresolved":false,"context_lines":[{"line_number":373,"context_line":"                            location.container, chunk_name, reader,"},{"line_number":374,"context_line":"                            content_length\u003dcontent_length)"},{"line_number":375,"context_line":"                        written_chunks.append(chunk_name)"},{"line_number":376,"context_line":"                    except Exception as e:"},{"line_number":377,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":378,"context_line":"                        LOG.exception(_(\"Error during chunked upload to \""},{"line_number":379,"context_line":"                                        \"backend, deleting stale chunks\"))"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAQn%2F%2F%2BAc%3D","line":376,"updated":"2013-07-18 09:42:10.000000000","message":"Sorry for the hassle, but I believe we don\u0027t need the \"as e\" part here","commit_id":"dc8dbda175a2755b891e6b56c555927053c8f805"}]}
