locked
Dynamics 365 intermittent plugin timeout errors RRS feed

  • Question

  • I have a solution installed with multiple clients spread across a number of instances of Dynamics 365 (online). Three of them have recently reported errors with plugins timing out. Not all of the plugins reporting this error belong to my solution. Here's an example from the plugin tracelog:

    Unexpected exception from plug-in (Execute): <my plugin namespace>: System.TimeoutException: Couldn’t complete execution of the <my plugin namespace> plug-in within the 2-minute limit

    Now, I would normally expect something like this to happen on a really complicated query. However, by adding further output to the trace I was able to narrow down the timeout to the very first RetrieveMultiple (fetchxml) call via the SDK. In my plugin, this is a really simple single-entity query that I would expect to take milliseconds to complete.

    As I said, this error happens intermittently. It is only happening on some Dynamics 365 instances, on the crm11, crm4 and crm (US) regions. I have been unable to reproduce on my own development instance of 365. The timeout has happened both synchronously and asynchronously.

    I have seen tracelogs where the same issue is happening in other third-party plugins. One client has opened a service case with Microsoft, but they are pointing the finger at the plugin developers.

    I have tried updating the SDK reference to a later version (currently using one from December 2016), but I don't want to go to the most recent as some clients are still on 365 8.x versions, whereas some are running 9.x. And besides, as the problem is intermittent, I don't think the SDK version is to blame.

    I'm really posting this to see if any other developers are seeing this problem on the 365 platform.



    I make games! http://gareth.pw Tweets: @garethiw

    Tuesday, January 2, 2018 1:22 PM

All replies

  • Hi,

    I would look firstly at your record count of the target entities. Simply put more records take longer to fetch.

    As this would hopefully be your first check when diagnosing this problem, there is another more subtle problem that I have encountered.

    I am assuming you are using a loop of some sort to find the records you need:

     foreach (var item in GetRecords())
                {
    //Do Stuff
                }

    The above code use the GetRecords() method to return the collection you are using.

    What I want to point out is that this way of doing things causes the "GetRecords()" method to fire repeatedly, which can cause things to slow down drastically.

     var recordCollection = GetRecords();

                foreach (var item in recordCollection)
                {
    //Do Stuff
                }

    The above method fires the GetRecords once and then iterates through the results.

    May not be the answer but maybe this will just point in another direction of diagnoses.

    Good luck.

    Don

    Monday, January 8, 2018 12:39 AM