Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-982

NettyTransceiver: can hang on connection interruption

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.6.2
    • java
    • None
    • Reviewed

    Description

      When stopping my avro server, I noticed that my avro client was hanging. This makes it impossible for my client to retry the operation, as it hangs inside the avro code:

      "pool-2-thread-1" prio=10 tid=0x00007fc66840e800 nid=0x75fc waiting on condition [0x00007fc674176000]
         java.lang.Thread.State: WAITING (parking)
              at sun.misc.Unsafe.park(Native Method)
              - parking to wait for  <0x00000007d7471bd0> (a java.util.concurrent.CountDownLatch$Sync)
              at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156)
              at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)
              at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:969)
              at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1281)
              at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:207)
              at org.apache.avro.ipc.CallFuture.get(CallFuture.java:116)
              at org.apache.avro.ipc.Requestor.request(Requestor.java:106)
              at org.apache.avro.ipc.specific.SpecificRequestor.invoke(SpecificRequestor.java:72)
      

      In a similar situation elsewhere in the NettyTransceiver (method exceptionCaught), the pending requests are canceled. It seems appropriate to do that also on closed connections. I'll attach a patch.

      Attachments

        1. AVRO-982.patch
          0.7 kB
          Bruno Dumon
        2. AVRO-982-testcase.patch
          9 kB
          Bruno Dumon

        Activity

          People

            bruno Bruno Dumon
            bruno Bruno Dumon
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: