Skip to content

Filename collision when running in workers. #196

Open
@lpaolini

Description

@lpaolini

In XMLHttpRequest.js lines 479-480, two filenames are defined using process.pid as a unique key.

      var contentFile = ".node-xmlhttprequest-content-" + process.pid;
      var syncFile = ".node-xmlhttprequest-sync-" + process.pid;

However, when running in workers this is not enough, due to the fact that the process.pid is the same across workers. This causes a filename collision.

Appending a UUID to the key fixes the problem.

      var uniqueId = process.pid + "-" + uuid.v4();
      var contentFile = ".node-xmlhttprequest-content-" + uniqueId;
      var syncFile = ".node-xmlhttprequest-sync-" + uniqueId;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions