-
Notifications
You must be signed in to change notification settings - Fork 51
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
Implement CloneAsync #447
Comments
Thanks for the feedback. You will find that the Async methods do not require a cloned connection to scale horizontally. Regarding cancelation tokens, the tokens are honored only withing the Dataverse service client itself, the API to the server does not currently support them. Once the request is executed on against the server, it cannot be canceled. Regarding 1.1.16 and clone, We fixed a few issues that were reported with clone in 1.1.17, You can see the full change set here: https://github.com/microsoft/PowerPlatform-DataverseServiceClient/releases/tag/1.1.17 Please let us know if 1.1.17 solves that for you.. if that does not fix it for you please reopen the issue. |
@MattB-msft thanks for reply. I believe the reason, why we Clone the client is described in this issue #93. |
@tovyhnal that said. try it out with the current version of DVSC and see if the perf issue persists. |
@MattB-msft Since you are advising to move away from the Sync methods I want to point your attention to the linq provider. Could the Linq provider get some async love? |
@tovyhnal |
We are seeing performance degradation of our services (thread processing gets stuck) and after initial investigation one of the suspect is Clone method of ServiceClient.
I checked the implementation of Clone method and there are two things, which can potentially cause performance/stability issues:
Sync over async
Found at least two places, when we do sync over async during Clone operation, this can block whole thread, which can lead to thread pool starvation.
-WhoAmIResponse resp = Task.Run(async () => await _connectionSvc.GetWhoAmIDetails(this).ConfigureAwait(false)).ConfigureAwait(false).GetAwaiter().GetResult();
-RefreshInstanceDetails(svc, _targetInstanceUriToConnectTo).ConfigureAwait(false).GetAwaiter().GetResult();
Not honoring cancellation token
Also there are places, which don't accept cancellation tokens when calling external service. This can lead to stuck requests and blocking calling thread.
Here is one of multiple examples:
resp = (WhoAmIResponse)(await Command_WebAPIProcess_ExecuteAsync(
req, null, false, null, Guid.Empty, false, _configuration.Value.MaxRetryCount, _configuration.Value.RetryPauseTime, new CancellationToken(), inLoginFlow:true).ConfigureAwait(false));
Would be possible to create CloneAsync(CancellationToken ct), which would be fully async and honor passed cancellation token?
We use v1.1.16
The text was updated successfully, but these errors were encountered: