microsoft / PowerPlatform-DataverseServiceClient

Code Replica for Microsoft.PowerPlatform.Dataverse.Client and supporting nuget packages.
MIT License
272 stars 49 forks source link

System.TimeoutException enrichment #131

Open pareszka opened 3 years ago

pareszka commented 3 years ago

Is it possible to enrich TimeoutException to include ActivityId/RequestId? We are getting from time to time TimeoutExceptions with message like that: The request channel timed out attempting to send after 00:01:00. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.

When trace logger is enabled, I can see messages coming from Dataverse lib, like that: [TerminalFailure] Failed to Execute Command - Retrieve : SessionID=someGuid : RequestID=anotherGuid : Retrieve Request to Dataverse via IOrganizationService duration...

Is it possible to pass this kind of data in an exception?

MattB-msft commented 3 years ago

Fair ask.. we will see what we can do here.. it will be a bit yet as we are heads down doing some updates on the engine to move things along.

MattB-msft commented 3 years ago

@pareszka We were ( finally ) talking about this one today.. few things... Are you using the IOrganizationService methods? meaning you called .Create /.Update? when you see this?

The reason we ask, there are a few different error patterns we expose here, we have tried to maintain the existing error patterns.

pareszka commented 3 years ago
@MattB-msft I'm sorry for a late response. This is a breakdown of methods of ServiceClient which threw timeout exceptions in past month: Method Count
RetrieveMultipleAsync(QueryBase query, CancellationToken cancellationToken) 1338
RetrieveAsync(String entityName, Guid id, ColumnSet columnSet, CancellationToken cancellationToken) 559
RetrieveMultiple(QueryBase query) 109
Retrieve(String entityName, Guid id, ColumnSet columnSet) 29
ExecuteAsync(OrganizationRequest request, CancellationToken cancellationToken) 126
Command_Execute(OrganizationRequest req, String errorStringCheck, Boolean bypassPluginExecution) 4