Route FilterDirectory#copyFrom through createOutput (10x backport of #16530) - #16539
Open
tballison wants to merge 2 commits into
Open
Route FilterDirectory#copyFrom through createOutput (10x backport of #16530)#16539tballison wants to merge 2 commits into
tballison wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport to
branch_10xof the non-breaking parts of #16530 (which follows up #16173).Replaces #16538.
#16173 (backported to 10x in 148ee2f) changed
FilterDirectory#copyFromto delegate to the wrapped directory, which hidFilterDirectorysubclasses that overridecreateOutputfor per-file bookkeeping (TrackingTmpOutputDirectoryWrapper,MockDirectoryWrapper,NRTCachingDirectory,DirectIODirectory,ByteWritesTrackingDirectoryWrapper).Differences from #16530, since we can't break the API on 10x:
Directory#copyFromkeeps its concrete default implementation (no abstract method, nocopyThroughCreateOutputhelper).FilterDirectory#copyFromroutes throughsuper.copyFrom— i.e. throughcreateOutput— instead of delegating, with javadoc noting that subclasses wanting an optimized copy (e.g.HardlinkCopyDirectoryWrapper) may override to delegate.CompoundDirectory,FileSwitchDirectory,BaseMergePolicyTestCase) are unnecessary here and are omitted.TrackingTmpOutputDirectoryWrapper#copyFromfailure cleanup usesIOUtils.deleteFilesIgnoringExceptionssincedeleteFilesSuppressingExceptions(Catch and re-throw Throwable rather than using a success boolean #14633) is main-only.Same as #16530:
TrackingTmpOutputDirectoryWrapper#copyFromfailure cleanup to delete the temp file rather than the logical dest name.TestFilterDirectory#testCopyFromRoutesThroughCreateOutput(replacestestCopyFromDelegates),TestTrackingTmpOutputDirectoryWrapper,TestByteWritesTrackingDirectoryWrapper#testCopyFromTracksBytes,TestDirectIODirectoryCopyFrom.The CHANGES entry replaces the #16173 entry under 10.6.0 Bug Fixes since this reverts that behavior before it ships in a
release.
Note: Normal process would be to push this backport directly to
branch_10x, I think. Since it reverts the behavior introduced by #16173, I'm opening a PR instead -- @msfroh, @iprithv, I'd appreciate your eyes on it before it goes in.Thank you!