Skip to content

Increment not working with parallel calls. #4892

Description

@elios264

Issue Description

Increment op not working with concurrent calls

Steps to reproduce

Do this:

222

Expected Results

a value of 4000 in the cost attribute

Actual Outcome

3562

11

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 2.8.2
    • Operating System: ubuntu
    • Hardware: ram 1gb,
    • Localhost or remote server? : DigitalOcean
  • Database

    • MongoDB version: 3.4
    • Storage engine: no idea
    • Hardware: n/a
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): everywhere, in my local computer too.

Logs/Trace

No error logs no nothing,

Activity

  1. flovilmart commented on Jul 12, 2018

    @flovilmart
    Contributor

    Are you sure all 4000 calls passed and none failed?

  2. elios264 commented on Jul 12, 2018

    @elios264
    Author

    I just tried again while watching the log,

    291 instead of 300

    capture

    In my original problem it happens with only 2-4 concurrent increments requested in cloud code with afterSaves hooks.

  3. flovilmart commented on Jul 12, 2018

    @flovilmart
    Contributor

    Again, there is no guarantee that all your calls are passing, and returning 2xx. Then if you say 2 concurrent increments cause an issue, that’s skmething else. But I’m not convinced that all your calls really are processed by the server and not dropped, throttled or else.

    In the case you’re describing, that would mean 2 different calls return with the same value. Which isn’t proved yet

  4. elios264 commented on Jul 12, 2018

    @elios264
    Author

    Upon trying to get a case where 2 different calls returning the same value, I discovered than other beforeSave hook was causing this bug,
    Sorry for the inconvenience!

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions