I’m having some bizarre issues, that are going to be a pain to re-create, so I thought I’d solicit the community’s input whilst I try to recreate the error!
I have a page that ends up creating a parent record and some child records. This child object is a child of two objects; both objects have roll up summaries. One of them itself is a child object of yet another object. There’s other stuff going on as well with Processes built with Process Builder, but you get the idea - the system has a lot to do when these records are saved. They are saved with an action that saves both models and has the “rollback on error” option checked.
There’s a managed package in this org that creates triggers based on an admin’s actions, i.e. they are in the org’s namespace. We have some of these triggers on the parent objects I mentioned before.
Back to Skuid. We were having issues with this page, getting CPU Limit exceeded messages (this is in the JS console). Debugging what was going on is really difficult (is it me or is debugging on Salesforce with managed packages a pain?). Occasionally, the parent object would be created, but not the children (I think I’ve had this addressed before, but need to revisit the answer now I have a bit more data). In the debug logs, I was able to see the FATAL_ERROR.
I suspected these managed-package-but-not-really triggers were to blame, so I deployed the necessary metadata to disable them. Back on the page, it was still reporting the CPU error - but all records were actually created successfully. In the debug logs, no trace of the FATAL_ERROR either. I can see a DML_BEGIN and a DML_END over 30 seconds later (and nothing in-between, despite the fact the system must be doing workflow, processes etc. Stupid debug logs!)
I appreciate this is a rather esoteric issue and it’s unlikely someone is come along and say “Me too! Here’s why…” but does anybody out there have any idea of what the possible causes might be or avenues of investigation? I’m actually thinking of moving the logic into a web service instead (as well as possibly other things to optimise performance - the solution was built to a deadline), as that gives me more options when it comes to figuring out what’s going on, but I’d love to hear ideas as to what may be causing this issue here.
My best guess so far: I’ve seen a Salesforce Known Issue that debug logs mis-report managed packages limits usage. Skuid is exceeding it’s CPU limit, but the transactions that it initiates are not. Therefore Skuid receives an error which is thrown back to the client, but the record creation actually succeeds. Now this sounds non-sensical to me - the work to insert the records would come under Skuid’s limits, and be considered a transaction in the skuid namespace, but maybe I mis-understand how managed packages work on the platform. Some weekend reading for me perhaps…
Thanks in advance, and for reading this far 🙂
Question
Bizarre behaviour with long running transactions
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.