[ 
https://issues.apache.org/jira/browse/IMPALA-10044?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17172802#comment-17172802
 ] 

ASF subversion and git services commented on IMPALA-10044:
----------------------------------------------------------

Commit bbec0443fcdabf5de6f7ae0e47595414503f30f0 in impala's branch 
refs/heads/master from Joe McDonnell
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=bbec044 ]

IMPALA-10044: Fix cleanup for bootstrap_toolchain.py failure case

If DownloadUnpackTarball::download()'s wget_and_unpack_package call
hits an exception, the exception handler cleans up any created
directories. Currently, it erroneously cleans up the directory where
the tarballs are downloaded even when it is not a temporary directory.
This would delete the entire toolchain.

This fixes the cleanup to only delete that directory if it is a
temporary directory.

Testing:
 - Simulated exception from wget_and_unpack_package and verified
   behavior.

Change-Id: Ia57f56b6717635af94247fce50b955c07a57d113
Reviewed-on: http://gerrit.cloudera.org:8080/16294
Reviewed-by: Laszlo Gaal <laszlo.g...@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>


> bin/bootstrap_toolchain.py error handling can delete the toolchain directory
> ----------------------------------------------------------------------------
>
>                 Key: IMPALA-10044
>                 URL: https://issues.apache.org/jira/browse/IMPALA-10044
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Infrastructure
>    Affects Versions: Impala 4.0
>            Reporter: Joe McDonnell
>            Priority: Major
>
> In bin/bootstrap_toolchain.py's DownloadUnpackTarball download() function, 
> the exception handler code will delete the download directory:
> {code:java}
>     except:  # noqa
>       # Clean up any partially-unpacked result.
>       if os.path.isdir(unpack_dir):
>         shutil.rmtree(unpack_dir)
>       if os.path.isdir(download_dir): # <---- wrong
>         shutil.rmtree(download_dir)
>       raise
> {code}
> This is incorrect. It should only delete the download directory if the 
> download directory is a temporary directory. Otherwise, it would be deleting 
> the actual toolchain directory (and forcing a redownload of everything).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org

Reply via email to