Skip to content

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

@manoj398

Description

@manoj398

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions