)]}'
{"nova_powervm/virt/powervm/nvram/swift.py":[{"author":{"_account_id":8190,"name":"Drew Thorstensen (thorst)","email":"thorst@us.ibm.com","username":"thorst"},"change_message_id":"6895efc19804e860d7d36c6094595b2c0dd68699","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        options \u003d dict(leave_segments\u003dTrue) if not exists else None"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"        obj \u003d swft_srv.SwiftUploadObject(source, object_name\u003dinst_key)"},{"line_number":147,"context_line":"        try:"},{"line_number":148,"context_line":"            for result in self._run_operation(\u0027upload\u0027, self.container,"},{"line_number":149,"context_line":"                                              [obj], options\u003doptions):"},{"line_number":150,"context_line":"                if not result[\u0027success\u0027]:"},{"line_number":151,"context_line":"                    # The upload failed."},{"line_number":152,"context_line":"                    raise api.NVRAMUploadException(instance\u003dinst_name,"},{"line_number":153,"context_line":"                                                   reason\u003dresult)"},{"line_number":154,"context_line":"        except swft_exc.ClientException:"},{"line_number":155,"context_line":"            # Upload operation failed due to expired Keystone token."},{"line_number":156,"context_line":"            # Retry SwiftClient operation to allow regeneration of token."},{"line_number":157,"context_line":"            self._run_operation(\u0027stat\u0027, container\u003dself.container,"},{"line_number":158,"context_line":"                                objects\u003d[obj], options\u003doptions)"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    @lockutils.synchronized(\u0027nvram\u0027)"},{"line_number":161,"context_line":"    def store(self, instance, data, force\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_18bacd6e","line":158,"range":{"start_line":147,"start_character":0,"end_line":158,"end_character":63},"updated":"2016-06-22 15:40:41.000000000","message":"Should we use that \u0027retrying\u0027 decorator?  Usually that looks pretty ugly, but this might be the right scenario for it?  Something to consider...","commit_id":"dc3dcebe4aefa2ce9ef2223df0f5839d7d86cbca"},{"author":{"_account_id":13537,"name":"Lauren Taylor","email":"lmtaylor@us.ibm.com","username":"lmtaylor"},"change_message_id":"d53dccfc20219f9d9db0fe7d03d3914b15cf4d92","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        options \u003d dict(leave_segments\u003dTrue) if not exists else None"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"        obj \u003d swft_srv.SwiftUploadObject(source, object_name\u003dinst_key)"},{"line_number":147,"context_line":"        try:"},{"line_number":148,"context_line":"            for result in self._run_operation(\u0027upload\u0027, self.container,"},{"line_number":149,"context_line":"                                              [obj], options\u003doptions):"},{"line_number":150,"context_line":"                if not result[\u0027success\u0027]:"},{"line_number":151,"context_line":"                    # The upload failed."},{"line_number":152,"context_line":"                    raise api.NVRAMUploadException(instance\u003dinst_name,"},{"line_number":153,"context_line":"                                                   reason\u003dresult)"},{"line_number":154,"context_line":"        except swft_exc.ClientException:"},{"line_number":155,"context_line":"            # Upload operation failed due to expired Keystone token."},{"line_number":156,"context_line":"            # Retry SwiftClient operation to allow regeneration of token."},{"line_number":157,"context_line":"            self._run_operation(\u0027stat\u0027, container\u003dself.container,"},{"line_number":158,"context_line":"                                objects\u003d[obj], options\u003doptions)"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    @lockutils.synchronized(\u0027nvram\u0027)"},{"line_number":161,"context_line":"    def store(self, instance, data, force\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_509b7a72","line":158,"range":{"start_line":147,"start_character":0,"end_line":158,"end_character":63},"in_reply_to":"3aaa91ec_18bacd6e","updated":"2016-06-22 21:47:55.000000000","message":"Are you suggesting \u0027retrying\u0027 the upload operation after the failure?  Or retrying the upload operation after the failure and after the \u0027stat\u0027 operation has been performed?","commit_id":"dc3dcebe4aefa2ce9ef2223df0f5839d7d86cbca"},{"author":{"_account_id":8190,"name":"Drew Thorstensen (thorst)","email":"thorst@us.ibm.com","username":"thorst"},"change_message_id":"643a2790c51958141f42bd4727a7c36d69095fac","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        options \u003d dict(leave_segments\u003dTrue) if not exists else None"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"        obj \u003d swft_srv.SwiftUploadObject(source, object_name\u003dinst_key)"},{"line_number":147,"context_line":"        try:"},{"line_number":148,"context_line":"            for result in self._run_operation(\u0027upload\u0027, self.container,"},{"line_number":149,"context_line":"                                              [obj], options\u003doptions):"},{"line_number":150,"context_line":"                if not result[\u0027success\u0027]:"},{"line_number":151,"context_line":"                    # The upload failed."},{"line_number":152,"context_line":"                    raise api.NVRAMUploadException(instance\u003dinst_name,"},{"line_number":153,"context_line":"                                                   reason\u003dresult)"},{"line_number":154,"context_line":"        except swft_exc.ClientException:"},{"line_number":155,"context_line":"            # Upload operation failed due to expired Keystone token."},{"line_number":156,"context_line":"            # Retry SwiftClient operation to allow regeneration of token."},{"line_number":157,"context_line":"            self._run_operation(\u0027stat\u0027, container\u003dself.container,"},{"line_number":158,"context_line":"                                objects\u003d[obj], options\u003doptions)"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    @lockutils.synchronized(\u0027nvram\u0027)"},{"line_number":161,"context_line":"    def store(self, instance, data, force\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_80a9117e","line":158,"range":{"start_line":147,"start_character":0,"end_line":158,"end_character":63},"in_reply_to":"3aaa91ec_509b7a72","updated":"2016-06-22 23:31:34.000000000","message":"Retrying the upload operation after the upload fails (wouldn\u0027t that alone create a new token?  I could be wrong).","commit_id":"dc3dcebe4aefa2ce9ef2223df0f5839d7d86cbca"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"2a5b191cf27522517c37cfaee57f0dc7453a0634","unresolved":false,"context_lines":[{"line_number":145,"context_line":"        options \u003d dict(leave_segments\u003dTrue) if not exists else None"},{"line_number":146,"context_line":"        obj \u003d swft_srv.SwiftUploadObject(source, object_name\u003dinst_key)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        @retrying.retry(retry_on_result\u003dlambda result: not result,"},{"line_number":149,"context_line":"                        wait_fixed\u003d250, stop_max_attempt_number\u003d2)"},{"line_number":150,"context_line":"        def _run_upload_operation():"},{"line_number":151,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_4f1f0d08","line":148,"range":{"start_line":148,"start_character":24,"end_line":148,"end_character":65},"updated":"2016-06-24 05:07:35.000000000","message":"Is there a way we can determine if the swiftclient error is definitely an issue with the Keystone token (without parsing the error message)? Otherwise we will be retrying the swiftclient operation for something that should have immediately been raised (albeit only one time).\n\nAlso, you probably already looked into it, but retry_on_exception looks like an alternative to having to play with the return value and retry_on_result.","commit_id":"9a3a3cdaf9dba5385fa6448f9e534036f09ab120"},{"author":{"_account_id":13537,"name":"Lauren Taylor","email":"lmtaylor@us.ibm.com","username":"lmtaylor"},"change_message_id":"b1cd04332f2e95970d64f7743e182cf24812414c","unresolved":false,"context_lines":[{"line_number":145,"context_line":"        options \u003d dict(leave_segments\u003dTrue) if not exists else None"},{"line_number":146,"context_line":"        obj \u003d swft_srv.SwiftUploadObject(source, object_name\u003dinst_key)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        @retrying.retry(retry_on_result\u003dlambda result: not result,"},{"line_number":149,"context_line":"                        wait_fixed\u003d250, stop_max_attempt_number\u003d2)"},{"line_number":150,"context_line":"        def _run_upload_operation():"},{"line_number":151,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_3030a49e","line":148,"range":{"start_line":148,"start_character":24,"end_line":148,"end_character":65},"in_reply_to":"3aaa91ec_4f1f0d08","updated":"2016-06-27 21:17:43.000000000","message":"We can\u0027t tell that the swiftclient error is an issue with the Keystone token. The ClientException is happening during the SwiftClient\u0027s retry operation. When the 401 occurs and we have not already retried authentication, we don\u0027t raise any exceptions and continue with a retry.  \n\nThe problem here is that for upload operations, the retry method takes a \u0027reset\u0027 function as the first parameter. This first parameter is normally \u0027None\u0027 for operations except the upload operation. For upload, it\u0027s set to a default method that throws a ClientException if the object to upload either doesn\u0027t implement tell()/see() or reset()... and we aren\u0027t, we are using six.StringIO(). So basically if the 401 occurs on the upload, then the ClientException is raised and there is no retry.  But for any other operation, SwiftClient will retry the operation and then succeed. \n\nhttps://github.com/openstack/python-swiftclient/blob/master/swiftclient/client.py#L1609","commit_id":"9a3a3cdaf9dba5385fa6448f9e534036f09ab120"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"2a5b191cf27522517c37cfaee57f0dc7453a0634","unresolved":false,"context_lines":[{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        try:"},{"line_number":160,"context_line":"            results \u003d _run_upload_operation()"},{"line_number":161,"context_line":"        except retrying.RetryError as re:"},{"line_number":162,"context_line":"            # The upload failed."},{"line_number":163,"context_line":"            raise api.NVRAMUploadException(instance\u003dinst_name, reason\u003dre)"},{"line_number":164,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_8fec55f4","line":161,"updated":"2016-06-24 05:07:35.000000000","message":"Will this contain the swiftclient exception stack trace with retry_on_result?","commit_id":"9a3a3cdaf9dba5385fa6448f9e534036f09ab120"},{"author":{"_account_id":13537,"name":"Lauren Taylor","email":"lmtaylor@us.ibm.com","username":"lmtaylor"},"change_message_id":"b1cd04332f2e95970d64f7743e182cf24812414c","unresolved":false,"context_lines":[{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        try:"},{"line_number":160,"context_line":"            results \u003d _run_upload_operation()"},{"line_number":161,"context_line":"        except retrying.RetryError as re:"},{"line_number":162,"context_line":"            # The upload failed."},{"line_number":163,"context_line":"            raise api.NVRAMUploadException(instance\u003dinst_name, reason\u003dre)"},{"line_number":164,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_b02134b7","line":161,"in_reply_to":"3aaa91ec_8fec55f4","updated":"2016-06-27 21:17:43.000000000","message":"I think this will show the last attempt instance which will include a stack trace.  Perhaps creating a new retry error with the number of attempts performed will be better.","commit_id":"9a3a3cdaf9dba5385fa6448f9e534036f09ab120"},{"author":{"_account_id":8190,"name":"Drew Thorstensen (thorst)","email":"thorst@us.ibm.com","username":"thorst"},"change_message_id":"0f0d154526507fb372bb2fc1111a367ddd30af5c","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            results \u003d _run_upload_operation()"},{"line_number":168,"context_line":"        except retrying.RetryError as re:"},{"line_number":169,"context_line":"            # The upload failed."},{"line_number":170,"context_line":"            reason \u003d (\u0027Unable to store NVRAM after %s attempts\u0027 %"},{"line_number":171,"context_line":"                      re.last_attempt.attempt_number)"},{"line_number":172,"context_line":"            raise api.NVRAMUploadException(instance\u003dinst_name, reason\u003dreason)"},{"line_number":173,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3aaa91ec_17dd2ce0","line":170,"updated":"2016-06-29 17:07:51.000000000","message":"Needs translation","commit_id":"b90f44d95e21954f26c7ac7a7facd2aa3ba7c717"},{"author":{"_account_id":13537,"name":"Lauren Taylor","email":"lmtaylor@us.ibm.com","username":"lmtaylor"},"change_message_id":"5febdff9b6af932d94aff8c415edcd89fac3a355","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            results \u003d _run_upload_operation()"},{"line_number":168,"context_line":"        except retrying.RetryError as re:"},{"line_number":169,"context_line":"            # The upload failed."},{"line_number":170,"context_line":"            reason \u003d (\u0027Unable to store NVRAM after %s attempts\u0027 %"},{"line_number":171,"context_line":"                      re.last_attempt.attempt_number)"},{"line_number":172,"context_line":"            raise api.NVRAMUploadException(instance\u003dinst_name, reason\u003dreason)"},{"line_number":173,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3aaa91ec_e35c224d","line":170,"in_reply_to":"3aaa91ec_17dd2ce0","updated":"2016-06-29 18:39:26.000000000","message":"Done","commit_id":"b90f44d95e21954f26c7ac7a7facd2aa3ba7c717"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0ec760848ef343b2782eb7983ee701c8ead3f2d8","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            results \u003d _run_upload_operation()"},{"line_number":168,"context_line":"        except retrying.RetryError as re:"},{"line_number":169,"context_line":"            # The upload failed."},{"line_number":170,"context_line":"            reason \u003d _(\u0027Unable to store NVRAM after %s attempts\u0027 %"},{"line_number":171,"context_line":"                      re.last_attempt.attempt_number)"},{"line_number":172,"context_line":"            raise api.NVRAMUploadException(instance\u003dinst_name, reason\u003dreason)"},{"line_number":173,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_758e257a","line":170,"range":{"start_line":170,"start_character":52,"end_line":170,"end_character":54},"updated":"2016-06-29 18:44:33.000000000","message":"%d","commit_id":"8e46b09d322468aa884157bd4bb217fa67f8d264"}]}
