PowerPlatform-DataverseServiceClient icon indicating copy to clipboard operation
PowerPlatform-DataverseServiceClient copied to clipboard

Why does WebProxyClient override Dispose to an empty method.

Open 8ggmaker opened this issue 2 years ago • 7 comments

https://github.com/microsoft/PowerPlatform-DataverseServiceClient/blob/254952f3a781f1ab363c56f1a43c4d9b49652fed/src/GeneralTools/DataverseClient/Client/Connector/WebProxyClient.cs#L209

The WebProxyClient's Dispose method seems close over the ClientBase's dispose method, and also I call ServiceClient.Dispose every time, there are lots of HttpClient in HttpChannelFactory: image

8ggmaker avatar Mar 26 '22 14:03 8ggmaker

if your using .net core, The issue your seeing is (we believe) unrelated to the dispose method, We believe this is a quirk of the WCF implementation in .net core.

Could you give us a bit more information on your use case? how are you using the client?

thanks

MattB-msft avatar Mar 29 '22 21:03 MattB-msft

We now create a connection pool of ServiceClient, there is a parent client with its clones, when the pool is ready to delete, we dispose the parent and clones

8ggmaker avatar May 15 '22 14:05 8ggmaker

@MattB-msft https://docs.microsoft.com/en-us/dotnet/framework/wcf/samples/use-close-abort-release-wcf-client-resources WebProxyClient is derived from ClientBase, but I dont see the Close or Abort methods get called in the code. https://github.com/dotnet/wcf/blob/580ce66ac5def05f67186681595a9748f6bdf135/src/System.Private.ServiceModel/src/System/ServiceModel/ClientBase.cs#L407

8ggmaker avatar May 15 '22 14:05 8ggmaker

@MattB-msft Could you help have a look at this issue, we are now using this sdk and will release at the end of this month, Thanks

8ggmaker avatar May 20 '22 04:05 8ggmaker

We will look at optimizing that, however that code has been in production use across the Microsoft ecosystem since 2015 with very few reported issues of this type. There is some research going on regarding this and memory consumption patterns on our servers.

That said, You should be fine to use it now.

We are keeping this item open while we research it.

MattB-msft avatar May 20 '22 14:05 MattB-msft

Thanks for the information, by the way, we use .net core, I don't know whether the implementation of WCF in .net core is different

8ggmaker avatar May 21 '22 06:05 8ggmaker

Lots of things are different in .net core unfortunately (or fortunately depending on view point :) ) The .net core team has recently released the rollup of the WCF work they have been doing with us and others... we are talking them about this currently.

MattB-msft avatar May 24 '22 04:05 MattB-msft