R – .NET Remoting server-side hanging

netremoting

We have a .net remoting application sitting in between web app and database. Occasionally we get strange problem. The remote call simply hangs and never returns. We used package sniffer to check the traffic. It seems to be the server side problem. If we stop the server app, a network exception will be thrown immediately. However when we debug the server code, it does not hit any code. It seems the request is blocked somewhere inside the remoting stacks. Does anyone have similar experience?

Best Answer

I did experience a similar issue in .Net remoting quite awhile ago, using IPC. I do not remember all the specifics, so forgive me. The problem that I discovered was that my client application was making a remote call to the server application which took a long time (minutes) to complete. After hooking both the client and the server up to the debugger, and catching all thrown exceptions, I discovered that the remote call actually ended up throwing a timeout exception of sorts (my memory wants to say the internal message was COM-related) since no activity was occurring over the IPC channel for the timeout period. Apparently when these remoting connections time out, the links on both sides are essentially dead-men-walking. Strangely, I was only ever able to see this exception through the debugger - in release mode, my application just hung like yours, without any indication as to why. I found the remoting Timeout settings, and simply turned off the Timeout (or made it ridiculously large, again I don't remember exactly), which fixed the problem.

Related Topic