gpt4 book ai didi

WCF : maxConcurrentCalls has exhausted

转载 作者:行者123 更新时间:2023-12-04 11:58:48 27 4
gpt4 key购买 nike

我正在对在某个时候挂起的 WCF 服务进行故障排除。
服务行为如下:

[ServiceBehavior( InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple )]

节流参数是:
<serviceThrottling maxConcurrentCalls="50" maxConcurrentSessions="50" maxConcurrentInstances="50" />

以下是从挂起转储中获取的服务状态:
0:000> !mdt 0000000000c9f270 -r
0000000000c9f270 (System.ServiceModel.Dispatcher.ServiceThrottle)
calls:0000000000c9f3d8 (System.ServiceModel.Dispatcher.FlowThrottle)
capacity:0x32 (System.Int32)
count:0x32 (System.Int32)
mutex:0000000000c9f418 (System.Object)
<NO FIELDS>
release:0000000000c9f398 (System.Threading.WaitCallback)
_target:0000000000c9f270 (System.ServiceModel.Dispatcher.ServiceThrottle)
<RECURSIVE>
_methodBase:NULL (System.Reflection.MethodBase)
_methodPtr:0000064273dddf30 (System.IntPtr)
_methodPtrAux:0000000000000000 (System.IntPtr)
_invocationList:NULL (System.Object)
_invocationCount:0000000000000000 (System.IntPtr)
<NO FIELDS>
waiters:0000000000c9f430 (System.Collections.Generic.Queue`1[[System.Object, mscorlib]])
_array:0000000028d73e70 (System.Object[], Elements: 16)
_head:0x1 (System.Int32)
_tail:0xA (System.Int32)
_size:0x9 (System.Int32)
_version:0x22 (System.Int32)
_syncRoot:NULL (System.Object)
propertyName:0000000000c9f2b8 (System.String: "MaxConcurrentCalls")
configName:0000000000c9f358 (System.String: "maxConcurrentCalls")
sessions:0000000000c9f508 (System.ServiceModel.Dispatcher.FlowThrottle)
capacity:0x32 (System.Int32)
count:0x9 (System.Int32)

....

instanceContexts:000000000105ffc8 (System.ServiceModel.Dispatcher.FlowThrottle)
capacity:0x32 (System.Int32)
count:0x32 (System.Int32)

如您所见,maxConcurrentCalls 已耗尽,而 session 数仅为 9。
我想知道这是否可能是由于客户端代码中有关代理使用的故障(例如异常处理不当)引起的?

给定服务的内存转储,有没有办法找到客户端 IP 地址?

TIA。

最佳答案

找到了问题的根源。
由于服务代码中的死锁,MaxConcurrentCalls 已耗尽。
我们正在使用 c# lock 关键字,似乎有时在受锁保护的代码中发生奇怪的事情时不会释放锁...

无论如何,感谢所有为此线程做出贡献的人。

关于WCF : maxConcurrentCalls has exhausted,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1163791/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com