kunwp1 commented on code in PR #5249:
URL: https://github.com/apache/texera/pull/5249#discussion_r3364253922


##########
amber/src/test/python/pytexera/storage/test_large_binary_output_stream.py:
##########
@@ -249,7 +249,7 @@ def test_multiple_close_calls(self, large_binary):
 
 
 class TestCleanupFailedUpload:

Review Comment:
   Maybe change the class name because `_cleanup_failed_upload` no longer 
exists.



##########
amber/src/main/python/pytexera/storage/large_binary_output_stream.py:
##########
@@ -153,12 +153,20 @@ def write(self, b: Union[bytes, bytearray]) -> int:
         if self._upload_thread is None:
 
             def upload_worker():
+                s3 = None
                 try:
                     
large_binary_manager._ensure_bucket_exists(self._bucket_name)
                     s3 = large_binary_manager._get_s3_client()
                     reader = _QueueReader(self._queue)
                     s3.upload_fileobj(reader, self._bucket_name, 
self._object_key)
                 except Exception as e:
+                    if s3 is not None:

Review Comment:
   I think it's better to move the logic below line 171 so that the next 
write() call can immediately throw an error.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to