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

Add KeyPromiseQueue to Push and Job StatusHandlers #7267

Merged
merged 3 commits into from
Mar 15, 2021

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Mar 15, 2021

New Pull Request Checklist

Issue Description

The current promise chain can lead to unwanted behavior like older update overriding the latest and timeouts. This could also be the cause for a lot of flaky tests.

Approach

This reused the KeyPromiseQueue used in the RedisCacheAdapter. The operations for push and jobs are queue by the objectId of the status objects. Not only will it reduce bottlenecks for request but it is designed that way to allow maximum data consistency and prevent operations from overlapping.

TODOs before merging

  • Add test cases
  • Add entry to changelog
  • Add changes to documentation (guides, repository pages, in-code descriptions)
  • Add security check
  • Add new Parse Error codes to Parse JS SDK
  • ...

@codecov
Copy link

codecov bot commented Mar 15, 2021

Codecov Report

Merging #7267 (e7d5e0d) into master (f7d2e09) will decrease coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7267      +/-   ##
==========================================
- Coverage   94.01%   93.96%   -0.05%     
==========================================
  Files         179      179              
  Lines       13144    13138       -6     
==========================================
- Hits        12357    12345      -12     
- Misses        787      793       +6     
Impacted Files Coverage Δ
src/KeyPromiseQueue.js 95.45% <ø> (ø)
src/Adapters/Cache/RedisCacheAdapter.js 94.73% <100.00%> (ø)
src/StatusHandler.js 98.49% <100.00%> (-0.07%) ⬇️
src/batch.js 91.37% <0.00%> (-1.73%) ⬇️
src/Adapters/Files/GridFSBucketAdapter.js 79.50% <0.00%> (-0.82%) ⬇️
src/Adapters/Storage/Mongo/MongoStorageAdapter.js 92.25% <0.00%> (-0.67%) ⬇️
src/RestWrite.js 93.84% <0.00%> (-0.17%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f7d2e09...4524819. Read the comment docs.

@dplewis dplewis requested review from davimacedo and mtrezza March 15, 2021 07:54
@davimacedo
Copy link
Member

@dplewis the tests are not passing. I'm not sure if it is because of this PR or the others we've already commited.

@dplewis
Copy link
Member Author

dplewis commented Mar 15, 2021

I think going forward we should ignore flaky test and test with network timeouts (transactions PG only and Parse.Push fixed here hopefully) until they are fixed. Otherwise reviews will take longer and we will be endlessly re running the CI in some cases.

@mtrezza What do you think?

@mtrezza
Copy link
Member

mtrezza commented Mar 15, 2021

we should ignore flaky test and test with network timeouts

Yes, that's an option. I was actually hoping that the annoyance of re-running tests incentivizes to fix the tests. My only concern would be that "hiding" the flakiness would lead to tests not being looked into and we end up piling them up, or even worse, hiding bugs. Didn't we fix most of the tests already?

@dplewis
Copy link
Member Author

dplewis commented Mar 15, 2021

Didn't we fix most of the tests already?

Yes we have. I don't know how many are left or which ones have been fixed. I assume there are about < 6 flaky tests left.

I was actually hoping that the annoyance of re-running tests incentivizes to fix the tests.

Annoyance is why I fixed the tests lol.

@mtrezza
Copy link
Member

mtrezza commented Mar 15, 2021

Annoyance is why I fixed the tests lol.

Hah! There you go, why would we want to change a working strategy 😉

@dplewis
Copy link
Member Author

dplewis commented Mar 15, 2021

We will still keep track of the flaky tests since they will be easier to find now. The transaction network timeouts shouldn't be a show stopper

@mtrezza What about this PR?

@mtrezza
Copy link
Member

mtrezza commented Mar 15, 2021

If that a FIFO queue? I think that's a good approach, doesn't seem related to the transactions test fails? I restarted.

@dplewis
Copy link
Member Author

dplewis commented Mar 15, 2021

If that a FIFO queue? I think that's a good approach, doesn't seem related to the transactions test fails? I restarted.

Thats right, also seems like the CI is stuck.
https://www.githubstatus.com/incidents/s654n76c1bwr

@dplewis dplewis closed this Mar 15, 2021
@dplewis dplewis reopened this Mar 15, 2021
@mtrezza
Copy link
Member

mtrezza commented Mar 15, 2021

Ah good, I would still wait to merge until actions work again, just to be sure.

@dplewis dplewis merged commit 32fc45d into master Mar 15, 2021
@dplewis dplewis deleted the statushandler-keypromisequeue branch March 15, 2021 23:51
@dplewis dplewis mentioned this pull request Mar 16, 2021
4 tasks
Arul- pushed a commit to Arul-/parse-server that referenced this pull request Mar 25, 2021
)

* Add KeyPromiseQueue to Push and Job StatusHandlers

* Update CHANGELOG.md

* Update CHANGELOG.md
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.0.0-beta.1

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Nov 1, 2021
@mtrezza mtrezza mentioned this pull request Mar 12, 2022
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.0.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-beta Released as beta version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants