jtharness
  1. jtharness
  2. JTHARNESS-35

Agent socket connection class does not handle interrupted exceptions correctly

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: jtharness-3_2_2-MR1-Rel-b01
    • Component/s: core
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      35

      Description

      SocketConnection.waitUntilClosed() does not clear the thread interrupted flag
      correctly before moving on to the next task (test).

      See
      http://weblogs.java.net/blog/simonis/archive/2007/11/testus_interrup_1.html

        Activity

        Hide
        bkurotsu added a comment -

        The blog suggests the following fix in Agent.Task.handleRequest():

        connection.waitUntilClosed(5000);
        if (Thread.interrupted() && tracing)

        { traceOut.println("Thread was interrupted - clearing interrupted status!"); }

        Alternate suggested fix in SocketConnection:
        finally {
        timer.cancel(e);
        if (Thread.interrupted()

        { throw new InterruptedException(); }

        ...
        }

        Show
        bkurotsu added a comment - The blog suggests the following fix in Agent.Task.handleRequest(): connection.waitUntilClosed(5000); if (Thread.interrupted() && tracing) { traceOut.println("Thread was interrupted - clearing interrupted status!"); } Alternate suggested fix in SocketConnection: finally { timer.cancel(e); if (Thread.interrupted() { throw new InterruptedException(); } ... }
        Hide
        bkurotsu added a comment -

        Commit to 4.1.4.

        Show
        bkurotsu added a comment - Commit to 4.1.4.
        Hide
        bkurotsu added a comment -

        Integrated. Both fixes used, since they solve the same problem at different
        levels in the code.

        Show
        bkurotsu added a comment - Integrated. Both fixes used, since they solve the same problem at different levels in the code.

          People

          • Assignee:
            bkurotsu
            Reporter:
            bkurotsu
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: