Skip to content

fs.writeFileSync intermittently does not create file on disk when called in parallel #1002

Closed
@cratter49

Description

@cratter49
  • Node.js Version: v8.8.0
  • OS: Linux 729a00fd3f64 4.4.74-boot2docker Update README for help #1 SMP Mon Jun 26 18:01:14 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  • Scope (install, code, runtime, meta, other?): runtime
  • Module (and version) (if relevant): fs

I'm currently running a custom Jupyter notebook server within a Docker container. In this server there is code that executes a NodeJS script one or more times which launches an instance of headless chrome, extracts some information from the DOM of a page that instance of headless chrome points to, and then writes that information to a file in a temporary directory using fs.writeFileSync from the fs module. When this script is executed multiple times in parallel sometimes the fs.writeFileSync does not seem to actually write the file to disk even though there are no errors thrown from the script. For example, when the script is executed six times in parallel on my Docker system one NodeJS process out of the six I launched will fail to write the file to disk. Additionally, I know that the file is written to a unique path with each execution of the script and using the asynchronous version of writeFile does not work.

Also, it's important to note that the file does not exist before this call is made.

Any ideas why the file write my not occur?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions