Skip to content

Conversation

@ambarve
Copy link
Contributor

@ambarve ambarve commented Jun 3, 2020

When pulling a multilayer image, the delta layers can delete some files or create new hard links. We have to do this file deletion or hard link creation after we are done with the ImportLayer call. However, these operations alter the last modification timestamps of the parent directories of these files. Some container applications depend on these timestamps and these applications don't work as expected when we delete the files or create hardlinks. This change reverts the timestamps after doing the delete or hard link creation operation so that the container applications depending on them aren't affected.

Signed-off-by: Amit Barve [email protected]

The github issue tracking this is here: #830

@ambarve ambarve requested a review from a team as a code owner June 3, 2020 21:13
@ambarve
Copy link
Contributor Author

ambarve commented Jun 3, 2020

WIP: Working on adding a test for this by creating a new image with 2 layers and pushing it to docker hub. Would like to get the code changes reviewed until then.

@ambarve ambarve force-pushed the user/ambarve/bug26547010 branch 2 times, most recently from 76e76e9 to 948edaa Compare June 8, 2020 22:05
@ambarve ambarve changed the title [WIP]Fix the timestamp bug in pulling a multi layer image. Fix the timestamp bug in pulling a multi layer image. Jun 8, 2020
When pulling a multilayer image, the delta layers can delete some files or create new hard links. We have to do this file deletion or hard link creation after we are done with the ImportLayer call. However, these operations alter the last modification timestamps of the parent directories of these files. Some container applications depend on these timestamps and these applications don't work as expected when we delete the files or create hardlinks. This change reverts the timestamps after doing the delete or hard link creation operation so that the container applications depending on them aren't affected.
Also, until now we only did this for files that aren't symlinks, with this change we will do it for files that are symlinks too. This had to be done because while exporting a layer we sometimes incorrectly adds the symlink attribute to a directory that isn't actually a symlink.

Signed-off-by: Amit Barve <[email protected]>
@ambarve ambarve force-pushed the user/ambarve/bug26547010 branch from 948edaa to 945b220 Compare June 8, 2020 22:14
@ambarve ambarve merged commit e50252d into master Jun 9, 2020
@ambarve ambarve deleted the user/ambarve/bug26547010 branch June 9, 2020 05:57
princepereira pushed a commit to princepereira/hcsshim that referenced this pull request Aug 29, 2024
Fix the timestamp bug in pulling a multi layer image.
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.

4 participants