-
Notifications
You must be signed in to change notification settings - Fork 27
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
Apex CPU time limit exceeded when a batch is run #539
Comments
@baobao917 I've managed to reproduce this issue this morning. I have some ideas on how to streamline the process to make these updates from Flows more performant. |
@baobao917 I'm nearly finished with the current round of optimizations, many of which I've pre-deployed to your sandbox. Hopefully I'll be able to wrap up this version today or tomorrow. |
…ciency of where RollupCalcItemReplacer is called, by optimizing RollupRecursionItem constructor, by removing a logging statement from RollupEvaluator that was chewing through CPU time
* Fixes #539 by optimizing Flow update code paths by improving the efficiency of where RollupCalcItemReplacer is called, by optimizing RollupRecursionItem constructor, by removing a logging statement from RollupEvaluator that was chewing through CPU time
Thanks @jamessimone ! I saw v1.6.5 was related to this. Do you have an idea of what the batch size improvement should be now? The full 200? I saw that you noted that this was the low hanging fruit and that possible future enhancements possibly are coming as well....looking forward to it! |
@baobao917 You can check out the |
I've created this issue b/c it is occurring more frequently now. Anytime I have to run an update on a batch of records of the rollup's child object, ApexRollup gets an Apex CPU time limit exceeded error. It occurs if it occurs in a scheduled flow or if I do a batch update of records directly. In my experience, I'm getting the error pretty consistently on any batches exceeding 70 (whereby the update operation isn't doing anything complicated...just populating a field value).
Discussed in #519
Originally posted by baobao917 October 8, 2023
I have a simple scheduled flow that runs that updates a collection of records. It is a very simple flow just updates one field on each of the records in the collection. It has previously worked without any issue.
These records are the child object in an Apex Rollup. Now that I've introduced the flow trigger on the child object, it has pushed the transaction time beyond the APEX CPU limit. I've tried to create the apex rollup flow trigger as asynchronous but it appears that it is not possible. Do you have any suggestions?
The text was updated successfully, but these errors were encountered: