Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increment not working with parallel calls. #4892

Closed
elios264 opened this issue Jul 12, 2018 · 4 comments
Closed

Increment not working with parallel calls. #4892

elios264 opened this issue Jul 12, 2018 · 4 comments

Comments

@elios264
Copy link

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,

@flovilmart
Copy link
Contributor

Are you sure all 4000 calls passed and none failed?

@elios264
Copy link
Author

elios264 commented Jul 12, 2018

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.

@flovilmart
Copy link
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

@elios264
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants