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

Possible lastUpdateCheck timestamp file corruption in UpdateChecker #2348

Closed
chanseokoh opened this issue Mar 20, 2020 · 1 comment · Fixed by #2479
Closed

Possible lastUpdateCheck timestamp file corruption in UpdateChecker #2348

chanseokoh opened this issue Mar 20, 2020 · 1 comment · Fixed by #2479
Milestone

Comments

@chanseokoh
Copy link
Member

chanseokoh commented Mar 20, 2020

This looks like a very similar (or the same) problem to #2294. However, this is a fairly minor and low-priority problem and mostly benign, because we auto-generate and overwrite the file every time. It will just be that Jib may do more frequent, unintended update checks.

In #2335, I saw this log:

03:03:20.913 [DEBUG] [org.gradle.api.Task] Failed to read lastUpdateCheck; Text '' could not be parsed at index 0

I am only guessing, but the message sounds like the file was empty.

We overwrite the file with Files.write(), and the JDK code works by opening an OutputStream. So I think it can have the same truncating issue with #2294.

        try (OutputStream out = Files.newOutputStream(path, options)) {
                ...
                out.write(bytes, (len-rem), n);
@chanseokoh chanseokoh added this to the v2.3.0 milestone Apr 21, 2020
@chanseokoh
Copy link
Member Author

It will just be that Jib may do more frequent, unintended update checks.

I think it's better to fix this earlier than later, because the metrics may get skewed when we fix this eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants