Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

download function should avoid race-condition #11646

@szha

Description

@szha

Currently the download function would directly write to target file path, which causes file integrity problem when multiple processes use the same logic to write to the same file.
https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/gluon/utils.py#L223-L226

Alternative is to write to a temporary file first, and only move to target path upon download completion after verifying file integrity. Temporary file should be cleaned up at the end. This should help solve issues like #11616

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions