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

[ch116145] 429 error when multiple datasets are requested to be deleted #15931

Merged

Conversation

Shylpx
Copy link
Collaborator

@Shylpx Shylpx commented Nov 12, 2020

Resources

Context

  • When a bulk dataset deletion attempt is performed, the information about each table is requested (using a single request per table), in order to check the links with other maps, and the consequences of the deletion process. And nginx raises a 429 error because too many requests are being made in parallel.
  • The suggested approach is based on reduce the number of request made on parallel, from 5 to 1. Due to, right now, in the environment production, nginx starts to block the requests usually from the second or the third request:

Screenshot from 2020-11-12 15-47-18
Screenshot from 2020-11-12 15-47-30

  • The process is already asynchronous, with a dialog loader, and this would be the time required in the local environment to request the information of 10 tables.

Screenshot from 2020-11-12 15-47-04

  • In fact, when the user confirms the decision to delete the datasets, the requests to do that are performed in the same way, one by one (for other reason).
  • I understand a better approach would be creating a new endpoint to request the information of all tables at the same time (if it doesn't exist), and update the required front-end components in order to use the new endpoint. But if this simple solution works, I'm not sure if the effort to implement the other solution is worth it, only to avoid a waiting time of a few seconds when a lot of datasets are selected to be deleted at the same time.

Changes

  • Change the limit of request made in parallel from 5 to 1.
  • Fix Jasmine tests.

@Shylpx Shylpx self-assigned this Nov 12, 2020
@Shylpx Shylpx marked this pull request as ready for review November 12, 2020 17:35
@VictorVelarde
Copy link
Contributor

👋 Hi @Shylpx! Thx for the PR.

The simple approach of reducing the parallel requests looks good enough right now (not sure if keeping 2 instead of 1 could keep a better balance between 429 errors & responsiveness, but that's up to you).

In any case, it would be great to have a staging env to test "how it feels to the user", once you move on (please, fix the tests 😄 !)

@Shylpx Shylpx requested review from VictorVelarde and removed request for VictorVelarde December 10, 2020 17:23
@Shylpx
Copy link
Collaborator Author

Shylpx commented Dec 29, 2020

Hi @VictorVelarde! Tests are passing now, and the following would be the performance in stage environment. Deleting 10 datasets requires around 3 seconds.

delete-datasets

Copy link
Contributor

@VictorVelarde VictorVelarde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 LGTM, just refresh the NEWS.md with latests changes in mastedr, and you're good to go.

(PD: Sorry for the long, long-time...)

@Shylpx Shylpx merged commit a3b7446 into master Jan 18, 2021
@Shylpx Shylpx mentioned this pull request Jan 21, 2021
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

Successfully merging this pull request may close these issues.

2 participants