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

fix: batched evaluate action params to a chunk size #36482

Merged
merged 3 commits into from
Oct 9, 2024

Conversation

AmanAgarwal041
Copy link
Contributor

@AmanAgarwal041 AmanAgarwal041 commented Sep 23, 2024

Description

In this PR, we fix the payload evaluation issue by adding a batching mechanism.

Root cause the issue here was that using yield call in loop tends to call stack overflow which is a known open issue in the redux-saga library. The popular workaround to this is to add yield delay(0 after n number of batch.

Fixes #36383

Automation

/test all

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11134117696
Commit: a3a583f
Cypress dashboard.
Tags: @tag.All
Spec:


Wed, 02 Oct 2024 01:49:36 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • Improvements
    • Enhanced processing efficiency by introducing a batching mechanism, allowing smoother handling of large data sets without blocking the event loop.

Copy link
Contributor

coderabbitai bot commented Sep 23, 2024

Walkthrough

The changes introduce a new constant, BATCH_CHUNK_SIZE, set to 100, and modify the iteration method over the value array. The previous for...of loop is replaced with a traditional for loop that utilizes an index variable. This adjustment includes a mechanism to yield control back to the event loop every 100 iterations, enhancing the processing flow of the array items.

Changes

Files Change Summary
app/client/src/sagas/ActionExecution/PluginActionSaga.ts Introduced BATCH_CHUNK_SIZE constant and modified iteration from for...of to a traditional for loop with yielding control every 100 iterations.

Suggested labels

Bug

In code we find a rhythm,
A constant set, a new algorithm.
With chunks of batch, we pause with grace,
Yielding time in the processing race.
A loop refined, control we lend,
To keep our app smooth, on that we depend! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added Bug Something isn't working Frontend This label marks the issue or pull request to reference client code High This issue blocks a user from building or impacts a lot of users Integrations Product Issues related to a specific integration Needs Triaging Needs attention from maintainers to triage Production Query & JS Pod Issues related to the query & JS Pod Query Forms Isuses related to the query forms labels Sep 23, 2024
@rishabhrathod01 rishabhrathod01 self-assigned this Sep 24, 2024
@rishabhrathod01 rishabhrathod01 added the ok-to-test Required label for CI label Sep 24, 2024
@AmanAgarwal041
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

github-actions bot commented Oct 2, 2024

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/11147450574.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 36482.
recreate: .

Copy link

github-actions bot commented Oct 2, 2024

Deploy-Preview-URL: https://ce-36482.dp.appsmith.com

@rishabhrathod01
Copy link
Contributor

rishabhrathod01 commented Oct 9, 2024

Merging this as the planned unit test which blocked this didn't help in asserting the call stack issue.

@rishabhrathod01 rishabhrathod01 merged commit a4f9905 into release Oct 9, 2024
84 checks passed
@rishabhrathod01 rishabhrathod01 deleted the fix/36383-batch-execute-payload branch October 9, 2024 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Frontend This label marks the issue or pull request to reference client code High This issue blocks a user from building or impacts a lot of users Integrations Product Issues related to a specific integration Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI Production Query Forms Isuses related to the query forms Query & JS Pod Issues related to the query & JS Pod
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: The stack trace limit gets exceeded if the data send to the execute call is large
3 participants