8000 Nondeterministic collisions on temp file in highly parallel environments · Issue #17 · dominictarr/excel-stream · GitHub
[go: up one dir, main page]

Skip to content

Nondeterministic collisions on temp file in highly parallel environments #17

Open

Description

@wompeter

The generation of temporary filenames in index.js is insufficient to allow this library to be used in highly parallel environments where it is reasonable to expect that multiple processes may start on the same millisecond.

This happens regularly in our environment because two separate excel-stream processes generate the same temp file name and collide with each other:

Uncaught exception:

[Error: j: error parsing [...]\AppData\Local\Temp\_1474854568720: Error: Corrupted zip or bug : unexpected signature (\x2F\x2E\x72\x65, expected \x50\x4B\x03\x04)
]
Error: j: error parsing [...]\AppData\Local\Temp\_1474854568720: Error: Corrupted zip or bug : unexpected signature (\x2F\x2E\x72\x65, expected \x50\x4B\x03\x04)

    at [...]\node_modules\excel-stream\index.js:49:34
    at ConcatStream.<anonymous> ([...]\node_modules\excel-stream\node_modules\concat-stream\index.js:36:43)
    at emitNone (events.js:72:20)
    at ConcatStream.emit (events.js:166:7)
    at finishMaybe ([...]\node_modules\excel-stream\node_modules\concat-stream\node_modules\readable-stream\lib\_stream_writable.js:475:14)
    at afterWrite ([...]\node_modules\excel-stream\node_modules\concat-stream\node_modules\readable-stream\lib\_stream_writable.js:361:3)
    at nextTickCallbackWithManyArgs (node.js:464:18)
    at process._tickDomainCallback (node.js:403:17)

Temporary filename generation should be handled in a secure and standard way, such as that provided by the 'tmp' library.

Activity

  1. added 3 commits that reference this issue on Sep 26, 2016
  2. added a commit that references this issue on Mar 29, 2017
  3. added a commit that references this issue on Apr 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      0