Skip to content

Race condition when inserting an object in DB #653

Description

@NicolasRitouet

With dpd-fileupload, you can upload many files within the same request.
With node > 4.1 it leads to the error E11000: duplicate key error
The problem is located in this function:
https://github.com/deployd/deployd/blob/master/lib/db.js#L288
The variable object on line 293 is not the right one, it's using the latest given in this function due to the different scope.
To fix it, we need to pass the right object all the way to the insert.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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