Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reliable session faulting for unknown reason

Tags:

session

wcf

I am trying to achieve the following - one client-side proxy instance (kept open) accessed by multiple threads using a reliable session. What I have managed so far is to have either A) a reliable session with a client-side proxy which is created and disposed per call or B) what I aim for, but without a reliable session.

When I enable reliable sessions on my binding however, the following behaviour is exhibited:

Client-side

Upon application startup everything appears to work fine until roughly 18 messages in to the WCF session. I firstly get the proxy.InnerChannel.Faulted event raised, then an exception is caught at the point where I am calling the method on the proxy. The exception is a System.TimeoutException, with message:

"The request channel timed out while waiting for a reply after 00:00:59.9062512. 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."

The inner exception has a similar message:

"The request operation did not complete within the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout."

With the method at the top of the inner stack trace being:

System.ServiceModel.Channels.ReliableRequestSessionChannel.SyncRequest.WaitForReply(TimeSpan timeout)

I then call proxy.Close followed by proxy.Abort (catching and ignoring exceptions). If I utilize the default settings (i.e. have simply <reliableSession/>), then calling proxy. Close results in another System.Timeout exception (although this time the allotted timeout is 00:00:00), however if I override the defaults as specified above no exception is thrown.

Service-side

Utilizing WCF tracing I get a System.ServiceModel.CommunicationException, with message:

"The sequence has been terminated by the remote endpoint. The session has stopped waiting for a particular reply. Because of this the reliable session cannot continue. The reliable session was faulted."

And a stack trace ending at:

System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)

When remotely attaching to the server I get the same message, which occurs when code execution steps over the return statement of my service in the service call which causes the error.

The puzzling thing to me is that the service is stable and runs with options A) or B) as decribed at the beginning of my post, and occurs after a varying number of messages (around 18). The former fact points to there being nothing wrong with the code (indeed I have checked that no exceptions are thrown), and the latter just serves to confuse me and is why I modified the settings on the reliable session binding.

I am quite stuck on this. Can anyone suggest why the reliable session would fault in such a way?

like image 541
Scarfman007 Avatar asked Jul 17 '09 13:07

Scarfman007


1 Answers

You need to overide the default ,and set your timeout higher or lower depends on cause,it seems the timout is causing an exception just after some other program has started or stopped just a millisecond before the exception

OR most likely cause

your alloted timeouts may be added as a continous single timeout of 18 min or 18 calls ..plus other usage times are added together as one complete time out .which may be why it asking for more time.

in any case ,you have to staticly set your own settings because automatic default will always over ride any changes you made..

type in your local host http binding name and set your closetimeout at maybe 5.00 min and maybe even change the request time as well . Requesttimeout 2.00 min

closeTimeout="00:05:00"

like image 187
kel Avatar answered Nov 11 '22 08:11

kel