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

Temp files generated during DAG generation won't cleanup properly. #25227

Closed
manoj398 opened this issue Jul 2, 2022 · 1 comment · Fixed by #25381
Closed

Temp files generated during DAG generation won't cleanup properly. #25227

manoj398 opened this issue Jul 2, 2022 · 1 comment · Fixed by #25381
Labels

Comments

@manoj398
Copy link
Contributor

manoj398 commented Jul 2, 2022

System information

Geth version: geth version
OS & Version: Windows/Linux/OSX
Commit hash : (if develop)

Actual behaviour

When old instances are cleaned up, here

for ep := int(c.epoch) - limit; ep >= 0; ep-- {
seed := seedHash(uint64(ep)*epochLength + 1)
path := filepath.Join(dir, fmt.Sprintf("cache-R%d-%x%s", algorithmRevision, seed[:8], endian))
os.Remove(path)
}

It won't consider any left out temp files generated during the process because they have a different name.

Expected behaviour

All files needs to be considered that were generated previously.

Steps to reproduce the behaviour

temp := path + "." + strconv.Itoa(rand.Int())

Shutdown the node when DAG is being generated, The temp file generated with the name + "." + randomInteger would be left out. During the cleanup in the further runs, it won't be considered for removal. The cachecount flag doesn't count such files which is wrong. These files are generally in GBs and waste resources on disk.

Backtrace

[backtrace]

When submitting logs: please submit them as text and not screenshots.

@ethereum ethereum deleted a comment Jul 19, 2022
@ligi
Copy link
Member

ligi commented Jul 21, 2022

yes - they should be deleted - would you make a PR to do so?

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

Successfully merging a pull request may close this issue.

3 participants
@ligi @manoj398 and others