Uploaded image for project: 'JBoss Remoting'
  1. JBoss Remoting
  2. JBREM-1307

TimedOutputStream OutputTimerTask call to close on SSL OutputStream blocks

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.2.3.SP2, 2.5.4.SP4
    • Fix Version/s: 2.5.4.SP5
    • Component/s: transport
    • Labels:
    • Environment:

      JBoss EAP 4.3.0 CP08 and CP10

    • Steps to Reproduce:
      Hide

      Configure remoting-bisocket-service.xml for SSL
      Publish messages to a topic with several subscribers
      Remove networking cable from a client/subscriber
      Wait the write timeout period
      Generate thread dump

      Show
      Configure remoting-bisocket-service.xml for SSL Publish messages to a topic with several subscribers Remove networking cable from a client/subscriber Wait the write timeout period Generate thread dump

      Description

      In order to provide a mechanism for timing out a network/socket write operation, the org.jboss.remoting.transport.socket.TimedOutputStream class starts a timer. If the duration of the write operation exceeds the timer interval, then the timer will call close() on the output stream. This interrupts the output stream write() operation and causes the write operation to throw an IOException.

      When the output stream uses secure sockets (SSL), however, the call to close() on the output stream can block indefinitely. The threads associated with the write() and close() operation will only clear when the tcp keepalive timeout mechanism in the operation system is invoked.

      This appears to be related to a know bug in the java runtime: http://bugs.sun.com/view_bug.do?bug_id=6358629

      Specifically, in a thread dump you will see:

      "Timer-9" daemon prio=10 tid=0x5016c400 nid=0x2638 waiting on condition [0x4cbad000]
      java.lang.Thread.State: WAITING (parking)
      at sun.misc.Unsafe.park(Native Method)

      • parking to wait for <0x585021a0> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:778)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1114)
        at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186)
        at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:262)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:720)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.sendAlert(SSLSocketImpl.java:1720)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.warning(SSLSocketImpl.java:1564)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.closeInternal(SSLSocketImpl.java:1362)
      • locked <0x58502030> (a com.sun.net.ssl.internal.ssl.SSLSocketImpl)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.close(SSLSocketImpl.java:1301)
        at com.sun.net.ssl.internal.ssl.AppOutputStream.close(AppOutputStream.java:80)
        at org.jboss.remoting.transport.socket.TimedOutputStream.close(TimedOutputStream.java:57)
        at org.jboss.remoting.transport.socket.TimedOutputStream$OutputTimerTask.run(TimedOutputStream.java:145)
        at java.util.TimerThread.mainLoop(Timer.java:512)
        at java.util.TimerThread.run(Timer.java:462)

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ron_sigal Ron Sigal
                  Reporter:
                  dgrove_redhat.com Doug Grove
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: