Kafka
  1. Kafka
  2. KAFKA-204

BoundedByteBufferReceive hides OutOfMemoryError

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 0.7
    • Fix Version/s: 0.7.1
    • Component/s: None
    • Labels:
      None

      Description

      private def byteBufferAllocate(size: Int): ByteBuffer = {
      var buffer: ByteBuffer = null
      try

      { buffer = ByteBuffer.allocate(size) }

      catch

      { case e: OutOfMemoryError => throw new RuntimeException("OOME with size " + size, e) case e2 => throw e2 }

      buffer
      }

      This hides the fact that an Error occurred, and will likely result in some log handler printing a message, instead of exiting with non-zero status. Knowing how large the allocation was that caused an OOM is really nice, so I'd suggest logging in byteBufferAllocate and then re-throwing OutOfMemoryError

      1. k204-v1.txt
        0.7 kB
        Chris Burroughs

        Activity

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development