-
Notifications
You must be signed in to change notification settings - Fork 558
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
Getting timeout error for operations above 30 seconds. #2368
Comments
@icardosos Thank you for reporting the issue. We are able to repro it and will investigate further. |
The cause of this is a little complicated. We used to instantiate our own instance of WinHttpHandler as at the time, HttpClientHandler didn't have sufficient API's to be able to do things like set a certificate validation callback handler. WinHttpHandler has some extra properties that can be set for various timeouts. One of these is ReceiveHeadersTimeout which is how long to wait until the response headers are returned. The default value for this is 30 seconds. We weren't setting this to a specific value and so this is the timeout which is applying. |
Thanks @mconnew would be great if you help me out with reflection approach |
@mconnew I am running into the same issue and would be very glad to get assistance! |
I have some code I've tested to fix this. I was about to post the solution when power went out in the office. We're having some unusual weather in Seattle right now. I'll post the code tomorrow. |
You can find the example code in a gist here, The type |
@mconnew , although your code works I'm not able to use it in my project because I don't want to call an endpoint twice and I can't change that service either. I've already try to change to a development build from myget but it didn't work, I created the project and the proxy by the WCF connected service it compiles but I got a runtime error seems like the proxy is looking for another version of System.ServiceModel.Primitives. Anyway, I will have to change my project to the full framework. Thank you |
After you ran WCF connected service, please update your .csproj to the version of System.ServiceModel.* packages to the version you want to use from myget (suppose you already added the myget feed to the list of your package feeds). |
Thanks @mconnew, the reflection solution worked! Will that solution break in the next release? |
@jpjohnson, yes it will break in the next release, but the next release won't have this problem. In the next release we don't use a DelegatingHandler as the handler in HttpClient so you could add code similar to this at line 29 of the gist: DelegatingHandler delegatingHandler = handlerField.GetValue(httpClient) as DelegatingHandler;
if(delegatingHandler == null) return; // HttpClientHandler is not a DelegatingHandler |
Thanks @mconnew, looking forward to next release. |
@mconnew I am still facing this issue. I am using third party vendors WCF service and that service takes more 30 seconds every time. I also tried to use reflection to fix this issue but not bale to fix it. Could you please assist me what I am doing wrong? |
@mconnew I think in you timeout fix gist executing real request to fill try
{
(client.ChannelFactory.CreateChannel(new EndpointAddress(uri)) as IRequestChannel).
Request(Message.CreateMessage(MessageVersion.None, null))
}
catch (Exception e)
{
} Or maybe anyone found a more elegant solution? |
Hi @mconnew, |
@mconnew , Re: Option 1). What is the myget package feed URL to be able to reference the development build? ~Thx |
Is there any estimation on when this issue will be released in 2.0.x? Br |
The issue is already fixed in recent 2.1 preview1 release. |
@zhenlan Tnx for your answer, but that is a preview and we are soon going for production. So my question then is: will there not be any more 2.0.x releases and/or when can we expect the preview to be released non preview. I suppose it will take some time for the preview so make it there? Br |
@zhenlan is there a ETA on a stable 2.1 (non-preview) release? Or at least a 2.0.6 release? |
Hi guys, I just installed the 2.1.300-preview1-008174 and it doesn't solve this problem yet. and if you use docker with linux container, neither reflection solution works. CAST ERROR, WinHttpHandler / |
@danielsmf, Preview did fix issue for me. I do not run the inside docker though. |
@liri2006 It's strange, in my local environment i had timeout, how did you set your timeout? Like this?
and
|
@danielsmf please make sure you are using |
That is it... I change to Package System.ServiceModel.Http -Version 4.5.0-preview1-26228-01 and it works!!! Thanks!! |
@carlottokjellkvist, @aifrim I understand it may take a little bit for 2.1 to reach stable, so we are working on a servicing release with the fix of this issue for 2.0. Currently, you can find these packages from myget below. Please give them a try if you can. https://dotnet.myget.org/feed/dotnet-core/package/nuget/System.ServiceModel.Duplex/4.4.2 Once we finish validation internally, we will release them to nuget.org. |
Hi, is it already on nuget when we expect it on nuget? |
@zhenlan is there a estimation for when it will be released? |
Hello, i'm also waiting for when this will be released stable on nuget. Am I understanding all this correctly if running .NET Core 2.0/2.1 and with System.ServiceModel.* 4.4.2 will solve the timeout problems? |
We got a few higher priority tasks lately. We are still testing packages. I am aiming to release them next week. Has anyone tried the packages and do they work for you?
@jiimaho, for .NET Core 2.0, yes, the v4.4.2 S.SM.* packages will solve the timeout problem. For .NET Core 2.1, the problem is already solved with our recently released v4.5.0-preview* packages. |
@zhenlan We are actually trying it right now and it seems to work as expected :-) |
Version 4.4.2 System.ServiceModel.* packages are released to nuget.org this morning. Please let us know if this solves your issue. |
Hi guys,
I'm getting timeout exception for operations that took more than 30 seconds. Here is my scenario:
Server Side: Basic Wcf Application (.NET full 4.6.1)
Basically, I have one endpoint that call Thread.Sleep
Client Side: Console Application (.NET Core 2.0)
A console application that call the service above, I used Wcf Connect Service to generate the proxy class (https://marketplace.visualstudio.com/items?itemName=erikcai-MSFT.VisualStudioWCFConnectedService)
When I set Thread.Sleep < 30, everything works fine but as soon as I put more 30 seconds and I'm always getting the timeout error in 30 seconds, I've already set all the possibles timeout but it does not work (considering the default timeout for binding does not make sense to set it)
The text was updated successfully, but these errors were encountered: