.net 远程处理每 100 秒停止一次
我们遇到了非常奇怪的问题,我们的一个应用程序正在使用 .net 远程处理不断查询服务器,并且每隔 100 秒该应用程序就会停止查询一小段时间,然后恢复操作。 问题出在客户端而不是服务器上,因为应用程序实际上同时查询多个服务器并同时停止从所有服务器接收数据。
We have very strange problem, one of our applications is continually querying server by using .net remoting, and every 100 seconds the application stops querying for a short duration and then resumes the operation. The problem is on a client and not on the server because applications actually queries several servers in the same time and stops receiving data from all of them in the same time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
100 秒是一个赠送的数字,因为它是 .Net 中 Web 请求的默认超时。
我过去曾见过,PSI(Microsoft Project 中的项目服务器接口)不会覆盖超时,因此应用了默认值 100 秒,并且会终止与其通信时间超过该时间的任何内容。
您是否有权访问所有代码,并且确定已在适用的情况下设置了超时,以便不会在您不知情的情况下应用任何默认值?
100 Seconds is a give away number as it's the default timeout for a webrequest in .Net.
I've seen in the past that the PSI (Project Server Interface within Microsoft Project) didn't override the timeout and so the default of 100 seconds was applied and would terminate anything talking to it for longer than that time.
Do you have access to all of the code and are you sure you have set timeouts where applicable so that any defaults are not being applied unbeknownst to you?
我以前从未见过这种行为,不幸的是,这是一个非常模糊的场景,我认为您将很难在这个板上找到遇到该问题的人。 它可能特定于您的应用程序。
我认为您可以进行一些调查来帮助您缩小问题范围。
I've never seen that behavior before and unfortunately it's a vague enough scenario I think you're going to have a hard time finding someone on this board who's encountered the problem. It's likely specific to your application.
I think there are a few investigations you can do to help you narrow down the problem.
应用程序如何编码来实现连续查询? 是连续循环吗? 或者带有 Thread.Sleep 的循环? 或者是在计时器上?,
首先确定您的系统是否在您期望的时间在代码中执行此“触发器”,或者如果是,并且远程服务器没有响应......所以, ...
如果您无法在可以调试的开发环境中重现此问题,那么,如果可以的话,我建议您向此循环添加代码,以便每次都将其写入日志文件(或其他一些持久性机制) “应该”检查它使用的任何条件来决定是否查询远程服务器,然后在问题再次发生时查看这些日志...
如果您可以在远程服务器中执行相同的操作,以记录服务器何时收到远程处理请求,这也会有帮助......
哦,是的,只是一个想法,(我不知道你是如何编码的......)但是如果你在客户端中使用单独的线程来发出远程处理请求,并且通道正在该单独的线程上注册和取消注册,请确保您正在消除请求冲突,因为您无法同时在同一台计算机上注册同一端口两次......
(尽管如果这是问题的话,这可能会在您的客户端中引发异常)
How is the application coded to implement the continuous querying? Is it in a continuous loop? or a loop with a Thread.Sleep? or is it on a timer ?,
It would first be useful to determine if your system is executing this "trigger" in your code when you expect it to, or if it is, and the remoting server is not responding... so, ...
if you cannot reproduce this issue in a development environment where you can debug it, then, if you can, I suggest you add code to this Loop to write out to a log file (or some other persistence mechanism) each time it "should" be examining whatever conditions it uses to decide whether to query the remoting server or not, and then review those logs when the problem reoccurs...
If you can do the same in your remoting server, to record when the server receives a remoting request, this would help as well...
... and oh yes, just a thought, (I don;t know how you have coded this... ) but if you are using a separate thread in client to issue the remoting request, and the channel is being registered, and unregistered on that separate thread, make sure you are deconflicting the requests, cause you can't register the same port twice on the same machine at the same time...
(although this should probably have raised an exception in your client if this was the issue)