Skip to content

Fix naivediffdriver timestamp precision bug#27209

Merged
mlaventure merged 1 commit intomoby:masterfrom
tonistiigi:sleep-between-layers
Oct 10, 2016
Merged

Fix naivediffdriver timestamp precision bug#27209
mlaventure merged 1 commit intomoby:masterfrom
tonistiigi:sleep-between-layers

Conversation

@tonistiigi
Copy link
Copy Markdown
Member

Fixes #21555

This hack was suggested as a fix 6 months ago and as no better options have been brought up I suggest we merge it. At least temporarily.

Note that this doesn't sleep between every layer, only if there is a chance of this bug happening(very fast write in the beginning of a full second).

Signed-off-by: Tonis Tiigi [email protected]

Comment thread daemon/graphdriver/fsdiff.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd propose to use time.Now().Truncate(time.Second) here and startTime.Add(time.Second).Sub(time.Now()) in sleep. It looks more understandable to me.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@tonistiigi tonistiigi force-pushed the sleep-between-layers branch from 858d71f to d1a8305 Compare October 7, 2016 20:52
@LK4D4
Copy link
Copy Markdown
Contributor

LK4D4 commented Oct 7, 2016

LGTM

1 similar comment
@mlaventure
Copy link
Copy Markdown
Contributor

LGTM

@mlaventure mlaventure merged commit 7ba3154 into moby:master Oct 10, 2016
@thaJeztah thaJeztah added this to the 1.13.0 milestone Oct 10, 2016
Copy link
Copy Markdown

@xproax xproax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

// Diff produces an archive of the changes between the specified
// layer and its parent layer which may be "".
func (gdw *NaiveDiffDriver) Diff(id, parent string) (arch archive.Archive, err error) {
startTime := time.Now()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

liusdu pushed a commit to liusdu/moby that referenced this pull request Oct 30, 2017
cherry-pick from: moby#27209

Signed-off-by: Tonis Tiigi <[email protected]>
Signed-off-by: Lei Jitang <[email protected]>
(cherry picked from commit d1a8305)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image layer contents are unstable

6 participants