Uploaded image for project: 'Spring Web Flow'
  1. Spring Web Flow
  2. SWF-554

implementations of ConversationLock.lock should throw exception after configurable timeout period

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.0.5, 2.0 M4
    • Fix Version/s: 2.0.0.RC1
    • Component/s: Core: Flow Executor
    • Labels:
      None

      Description

      Using SWF 1.0.5 in a JSR 168 portlet on WebSphere. This also looks to be an issue with 2.0M4 code, so I'm reporting it against that too. The FlowExecutorImpl locks a conversation upon resume() or refresh() in 1.0.5 and resumeExecution() in 2.0 M4. The ConversationLock is implemented by JdkConcurrentConversationLock in JDK 1.5+ and UtilConcurrentConversationLock in JDK 1.4. In both cases, it uses the lock variant that waits infinitely unless interrupted.

      For UtilConcurrentConversationLock, it would be better to do ReentrantLock.attempt(long msecs) instead of ReentrantLock.acquire(); and in JdkConcurrentConversationLock it would be better to do ReentrantLock.tryLock(long time, TimeUnit unit). Then have a reasonable default wait time, e.g. 30 seconds, and allow that to be customized. If time period elapses without acquiring the lock, propagate an exception out of SWF to fail the request.

      The use case for this is that a flow becomes hung inside an action execution due to a deadlock or something. The user sees their browser waiting, so tries to submit the request again and again and again. What would have been one hung thread (not Spring's fault) is now 1 + N, aggravating the problem and opening the door to exhausting the web container thread pool.

        Attachments

          Activity

            People

            Assignee:
            kdonald Keith Donald
            Reporter:
            agaalswyk aaron gaalswyk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: