Skip to content

Race condition when inserting an object in DB #653

@NicolasRitouet

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.

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