Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trigger clean dir when unzip fails with IOException #6178

Merged
merged 1 commit into from Aug 17, 2018

Conversation

kaijianding
Copy link
Contributor

SegmentManager, SegmentLoaderLocalCacheManager, and many pullers catch IOException and wrap IOException as SegmentLoadingException, and only clean dir when SegmentLoadingException happens.
But the unzip method will wrap all exceptions to RuntimeException, then the clean logic is not going to be triggered. unzip should try best to throw IOException instead of RuntimeException

 try {
    return RetryUtils.retry(
        () -> unzip(byteSource.openStream(), outDir),
        shouldRetry,
        DEFAULT_RETRY_COUNT
    );
  }
  catch (Exception e) {
    throw Throwables.propagate(e);// here, RuntimeException is not appropriate
  }

@fjy fjy added this to the 0.13.0 milestone Aug 17, 2018
@fjy fjy merged commit 78fc5b2 into apache:master Aug 17, 2018
@kaijianding kaijianding deleted the unzip branch August 17, 2018 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants