ICEfaces
  1. ICEfaces
  2. ICE-4688

Add a timeout to the semaphore acquire invocation and log an error message after the timeout has been reached.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.1
    • Fix Version/s: 1.8.2-RC1, 1.8.2
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces Core, ICEfaces Push Server

      Description

      Currently, when using the semaphore logic, trying to acquire the semaphore is done without specifying a timeout. In case of a thread leak the Servlet Container supplied thread will block indefinitely. Introducing a timeout on the acquire call provides a failsafe mechanism. On timeout a warning message should be logged stating that a request has been pending for the specified timeout, including details on the request. Though this avoids a particular thread leak in this area, the underlying problem causing this to happen still needs to be addressed in the future.

      Basically, in the ThreadBlockingAdaptingServlet the Semaphore.acquire() method is invoked which blocks the container thread. This semaphore should be released in a timely fashion. However, in case it does not get released, it should not get stuck in the acquire() invocation for the remainder of the JVM lifespan. We should introduce a timeout and an error message to inform of the situation.

        Activity

        Jack Van Ooststroom created issue -
        Jack Van Ooststroom made changes -
        Field Original Value New Value
        Assignee Jack Van Ooststroom [ jack.van.ooststroom ]
        Jack Van Ooststroom made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Jack Van Ooststroom made changes -
        Salesforce Case []
        Fix Version/s 1.8.2 [ 10190 ]
        Jack Van Ooststroom made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Jack Van Ooststroom made changes -
        Salesforce Case []
        Description Introduce a safety net in case of hanging threads when using thread blocking. Currently in ThreadBlockingAdaptingServlet the Semaphore.acquire() method is invoked which blocks the container thread. This semaphore should be released in a timely fashion. However, in case it does not get released, it should not get stuck in the acquire() invocation for the remainder of the JVM lifespan. We should introduce a timeout and an error message to inform of the situation. Currently, when using the semaphore logic, trying to acquire the semaphore is done without specifying a timeout. In case of a thread leak the Servlet Container supplied thread will block indefinitely. Introducing a timeout on the acquire call provides a failsafe mechanism. On timeout a warning message should be logged stating that a request has been pending for the specified timeout, including details on the request. Though this avoids a particular thread leak in this area, the underlying problem causing this to happen still needs to be addressed in the future.

        Basically, in the ThreadBlockingAdaptingServlet the Semaphore.acquire() method is invoked which blocks the container thread. This semaphore should be released in a timely fashion. However, in case it does not get released, it should not get stuck in the acquire() invocation for the remainder of the JVM lifespan. We should introduce a timeout and an error message to inform of the situation.
        Ken Fyten made changes -
        Fix Version/s 1.8.2-RC1 [ 10210 ]
        Jack Van Ooststroom made changes -
        Environment ICEfaces Core ICEfaces Core, ICEfaces Push Server
        Salesforce Case []
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Jack Van Ooststroom
            Reporter:
            Jack Van Ooststroom
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: