工作流服务在收到 464 消息后停止响应

发布于 2025-01-04 19:34:10 字数 1464 浏览 1 评论 0原文

我在执行工作流程时遇到一个特殊问题。
我已经尝试了我能想到的一切,现在需要想法。

这是我的配置:
1. 在 IIS 7 中托管的 WF4 工作流服务 (xamlx),并使用 net.msmq/netMsmqBinding 进行传输(MSMQ 是事务性的)。
2. 不使用工作流持久性。
3. 我使用控制台应用程序客户端将消息发送到工作流(每条消息都会创建新的工作流)。 4. 每个工作流程如下所示:等待 START 消息 ->等待 END 消息(我只发送 START 消息)。

如果我发送 500 条消息 - 464 条得到正确处理,但除此之外,所有消息都会进入 lock_* 队列,然后移至有毒队列。 我检查了调试、分析事件日志以及消息和跟踪 svclogs 这是我收到的最详细的消息:

System.TimeoutException,mscorlib, 版本=4.0.0.0,文化=中立, PublicKeyToken=b77a5c561934e089操作 未在指定的超时 00:00:30 内完成。时间 分配给此操作的可能是更长的操作的一部分 暂停。在 System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult 结果) at System.ServiceModel.Activities.Dispatcher.PersistenceProviderDirectory.LoadOrCreateAsyncResult.HandleReserveThrottle(IAsyncResult 结果)在 System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult 结果)System.TimeoutException: 操作未在指定的超时 00:00:30 内完成。 分配给此操作的时间可能是某个操作的一部分 更长的超时时间。在 System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult 结果) at System.ServiceModel.Activities.Dispatcher.PersistenceProviderDirectory.LoadOrCreateAsyncResult.HandleReserveThrottle(IAsyncResult 结果)在 System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult 结果)

此时对 http://localhost/MyWebService?wsdl 的请求也失败并显示 404。

如果我重新启动 IIS - 一切都会恢复正常,直到发送 464 消息。

  1. 哪里可以找到更详细的日志? (我已经将 System.Diagnostics 设置为最大详细程度)
  2. 数字 464 到底有没有魔力?
  3. 是什么导致此 Web 服务锁定?

I am having a peculiar issue while executing workflows.
I have tried everything I could think of and now need ideas.

Here is my configuration:
1. A WF4 Workflow Service (xamlx) hosted in IIS 7 and uses net.msmq/netMsmqBinding for transport (MSMQ is transactional).
2. No Workflow Persistence is used.
3. I use a console app client to send messages to the workflow (each message creates new workflow).
4. Each workflow looks like: Wait for START message -> Wait for END message (I only send START messages).

If I send 500 messages - 464 get processed correctly, but above that all messages go to the lock_* queue and then move to poison queue.
I have inspected Debug, Analytic event logs, as well as messages and trace svclogs
Here is most detailed message I get:

System.TimeoutException, mscorlib,
Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089The operation
did not complete within the allotted timeout of 00:00:30. The time
allotted to this operation may have been a portion of a longer
timeout. at
System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) at
System.ServiceModel.Activities.Dispatcher.PersistenceProviderDirectory.LoadOrCreateAsyncResult.HandleReserveThrottle(IAsyncResult
result) at
System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult
result)System.TimeoutException: The
operation did not complete within the allotted timeout of 00:00:30.
The time allotted to this operation may have been a portion of a
longer timeout. at
System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) at
System.ServiceModel.Activities.Dispatcher.PersistenceProviderDirectory.LoadOrCreateAsyncResult.HandleReserveThrottle(IAsyncResult
result) at
System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult
result)

at that point request to http://localhost/MyWebService?wsdl also fails with 404.

If I restart IIS - everything goes back to normal until 464 messages are sent.

  1. Where can I find more detailed log? (I already have System.Diagnostics set to max verbosity)
  2. Is number 464 magic at all?
  3. What can be causing this web service locking up?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

双马尾 2025-01-11 19:34:10

听起来您似乎遇到了限制,这些设置适用于 WF4,就像适用于 WCF 一样。 maxConcurrentInstances 设置设置给定时间内存中可容纳的最大工作流实例数。

<behaviors> 
  <serviceBehaviors> 
    <behavior name="WorkflowServiceBehavior"> 
      <!-- Specify throttling behavior -->
      <serviceThrottling maxConcurrentInstances="1000"/> 
    </behavior>
  </serviceBehaviors>
</behaviors>

顺便说一句,在 IIS 中托管时应始终使用持久性。 IIS 迟早会重新启动 AppDomain,如果 WorkflowServicehost 无法将工作流实例的状态保存到磁盘,它们就会丢失。这还意味着可以从内存中删除空闲的工作流实例,并且不计入 maxConcurrentInstances(内存限制)。

It sounds like you are running into the throttling limits, these settings apply to WF4 as much as they do to WCF. The maxConcurrentInstances setting sets the maximum number of workflow instances that can be in memory at a given time.

<behaviors> 
  <serviceBehaviors> 
    <behavior name="WorkflowServiceBehavior"> 
      <!-- Specify throttling behavior -->
      <serviceThrottling maxConcurrentInstances="1000"/> 
    </behavior>
  </serviceBehaviors>
</behaviors>

Just as an aside you should always use persistence when hosting in IIS. Sooner or later IIS is going to restart the AppDomain and if the WorkflowServicehost can't save the state of the workflow instances to disk they will be lost. It will also mean that idle workflow instances can be removed from memory and don't count against the maxConcurrentInstances which is an in memory restriction.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文