Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-305

SyncProducer does not correctly timeout

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 0.7, 0.8.0
    • 0.8.0
    • core
    • None

    Description

      So it turns out that using the channel in SyncProducer like we are to perform blocking reads will not trigger socket timeouts (though we set it) and will block forever which is bad. This bug identifies the issue: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4614802 and this article presents a potential work-around: http://stackoverflow.com/questions/2866557/timeout-for-socketchannel for workaround. The work-around is a simple solution that involves creating a separate ReadableByteChannel instance for timeout-enabled reads.

      Attachments

        1. KAFKA-305-v2.patch
          31 kB
          Prashanth Menon
        2. KAFKA-305-v1.patch
          14 kB
          Prashanth Menon
        3. BlockingChannel2.scala
          5 kB
          Prashanth Menon

        Issue Links

          Activity

            People

              prashanth.menon Prashanth Menon
              prashanth.menon Prashanth Menon
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: