I'm facing an issue while developing a plugin that I've yet to encounter.
Mind you I've developed plugins far more complex than this one, but it's my first time seeing this proiblem.
I've a plugin that triggers on Create (PostOperation), Update (PostOperation) and Delete (PreOperation) of an entity.
It calculates a few things and updates the values of a related record in the target entity's lookup field.
The issue is - apparently - a timeout. The full error reads as follows:
'Operation not allowed as plugin execution exceeded maximum allowed time'
Based on what I know, the plugin timeout duration is two minutes.
The issue is that this error appears as soon as the plugin executes.
So as soon as you save a new record, update an existing or delete and exiting record, you get an error popup.
The entity in question doesn't have another plugin registered on any of its operations.
Profiling doesn't help much as it essentially bypasses the error and the plugin executes successfully.
After digging around with trace statements, I've found that the plugin always stops executing at any service.Retrieve / service.RetrieveMultiple calls.
So I assume that the issue is from them, but I have no idea what to do next, nor has research turned up anything to be honest.
The problem always occured on a retrieve and profiling also bypassed the problem.
It was sporadic error. So sometimes the update worked and sometimes it didn't.
A hypothesis for this was, that we had an update on the entity and then retrieved same entity afterwards.
So there was a post operation entity that the plugin was running on then a differed from the database entity because of update earlier in plugin.
When we split this into 2 plugins with execution order 1 and 2. the problem was solved.
We are not completely sure that this is what the problem was. Only that separating this into another plugin to run afterwards seemed to have solved the problem.
I cant really explain why this would be the problem. It was a hunch that i tried to separate the plugin code, that turned out to work.
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.