Practical value for concurrent-request-timeout parameter or options for avoiding concurrent access to conversation exception

喜夏-厌秋 提交于 2019-12-03 16:21:37

We use 60000 or 120000 (1-2 minutes). Concurrent-request-timeout is designed to avoid deadlocks. Historically we have far more problems with timeouts than deadlocks. A better approach is to use a client-side queue (<a4j:ajaxQueue> if using RichFaces) to serialize and remove duplicate requests as much as possible, then set the timeout high enough to avoid any remaining problems.

There are many serious issues resulting from Seam's concurrent request timeouts:

  • The issue is the last request gets the ConcurrentRequestTimeoutException. If the user double-clicks or reloads the page, only the last request matters -- why should he get an error?
  • Usually the ConcurrentRequestTimeoutException is suppressed, and only secondary NullPointerExceptions and @In injection failures are shown, making debugging difficult.
  • Seam 2.2.1 has a severe problem where transactions, ThreadLocals, and locks may leak after a timeout occurs, especially when used with <spring:spring-transaction/>. Look at SeamPhaseListener.afterRestoreView: there's no finally block to clean up after restoreConversation fails!

In my opinion there are many poor aspects to this design, so it's best to use a much higher timeout and try to avoid the issues.

This is what we have and it works fine for us:

<core:manager concurrent-request-timeout="5000"
    conversation-timeout="120000" conversation-id-parameter="cid"
    parent-conversation-id-parameter="pid" />

We also use a much higher value for the concurrent-request-timeout.

At least for duplicate events you can use settings in the a4j components to filter and delay them with eventsQueue, requestDelay and ignoreDupResponses=”true”.

(Last point http://docs.jboss.org/seam/2.0.1.GA/reference/en/html/conversations.html )

Can you analyse which types of request are taking a long time? Is there a particular type which you could reduce the request time by doing the "work" asynchronously and getting the update back in your poll?

In my opinion, ajax requests should always complete fairly quickly, then you can calculate a max concurrent request time by (request time * max number of requests likely to be initiated)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!