You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Chris Burroughs (Created) (JIRA)" <ji...@apache.org> on 2011/11/15 17:32:51 UTC

[jira] [Created] (KAFKA-204) BoundedByteBufferReceive hides OutOfMemoryError

BoundedByteBufferReceive hides OutOfMemoryError
-----------------------------------------------

                 Key: KAFKA-204
                 URL: https://issues.apache.org/jira/browse/KAFKA-204
             Project: Kafka
          Issue Type: Bug
    Affects Versions: 0.7
            Reporter: Chris Burroughs
            Priority: Critical


  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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-204) BoundedByteBufferReceive hides OutOfMemoryError

Posted by "Neha Narkhede (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156065#comment-13156065 ] 

Neha Narkhede commented on KAFKA-204:
-------------------------------------

+1
                
> BoundedByteBufferReceive hides OutOfMemoryError
> -----------------------------------------------
>
>                 Key: KAFKA-204
>                 URL: https://issues.apache.org/jira/browse/KAFKA-204
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Chris Burroughs
>            Assignee: Chris Burroughs
>            Priority: Critical
>         Attachments: k204-v1.txt
>
>
>   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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-204) BoundedByteBufferReceive hides OutOfMemoryError

Posted by "Jay Kreps (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13155739#comment-13155739 ] 

Jay Kreps commented on KAFKA-204:
---------------------------------

I understand the intent, but the important thing here is not to swallow the OOM exception, right? I mean once you hit that all bets are off, you need to restart your process...basically I think we shouldn't be messing with that.
                
> BoundedByteBufferReceive hides OutOfMemoryError
> -----------------------------------------------
>
>                 Key: KAFKA-204
>                 URL: https://issues.apache.org/jira/browse/KAFKA-204
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Chris Burroughs
>            Assignee: Chris Burroughs
>            Priority: Critical
>         Attachments: k204-v1.txt
>
>
>   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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-204) BoundedByteBufferReceive hides OutOfMemoryError

Posted by "Erik van Oosten (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13153485#comment-13153485 ] 

Erik van Oosten commented on KAFKA-204:
---------------------------------------

If you rethrow, then rethrow a new OOME with the original OOME wrapped.
                
> BoundedByteBufferReceive hides OutOfMemoryError
> -----------------------------------------------
>
>                 Key: KAFKA-204
>                 URL: https://issues.apache.org/jira/browse/KAFKA-204
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Chris Burroughs
>            Assignee: Chris Burroughs
>            Priority: Critical
>         Attachments: k204-v1.txt
>
>
>   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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-204) BoundedByteBufferReceive hides OutOfMemoryError

Posted by "Jun Rao (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13156061#comment-13156061 ] 

Jun Rao commented on KAFKA-204:
-------------------------------

Ok, I am fine with the patch then. Any objection to commit it?
                
> BoundedByteBufferReceive hides OutOfMemoryError
> -----------------------------------------------
>
>                 Key: KAFKA-204
>                 URL: https://issues.apache.org/jira/browse/KAFKA-204
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Chris Burroughs
>            Assignee: Chris Burroughs
>            Priority: Critical
>         Attachments: k204-v1.txt
>
>
>   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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-204) BoundedByteBufferReceive hides OutOfMemoryError

Posted by "Chris Burroughs (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13155857#comment-13155857 ] 

Chris Burroughs commented on KAFKA-204:
---------------------------------------

> I mean once you hit that all bets are off, you need to restart your process...basically I think we shouldn't be messing with that. 

Yeah, the most important thing to do is get out of the way and let the process exit with a non-zero status code.

So the options as I see it are:
 (1) Do something ugly (like pass the original fetch request to byteBufferAllocate) for the purposes of a valiant but possible futile logging attempt (there is no guarantee we will be able to allocate the logging Strings we are already asking for, everything we ad makes that less likely).
 (2)  Just rethrow e after a logging attempt in byteBufferAllocate.

My preference is (2), but if someone prefers (1) that's a reasonable trade off.
                
> BoundedByteBufferReceive hides OutOfMemoryError
> -----------------------------------------------
>
>                 Key: KAFKA-204
>                 URL: https://issues.apache.org/jira/browse/KAFKA-204
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Chris Burroughs
>            Assignee: Chris Burroughs
>            Priority: Critical
>         Attachments: k204-v1.txt
>
>
>   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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-204) BoundedByteBufferReceive hides OutOfMemoryError

Posted by "Jun Rao (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13153919#comment-13153919 ] 

Jun Rao commented on KAFKA-204:
-------------------------------

Hmm, it doesn't look like OutOfMemoryError allow one to specify a cause during initialization.
                
> BoundedByteBufferReceive hides OutOfMemoryError
> -----------------------------------------------
>
>                 Key: KAFKA-204
>                 URL: https://issues.apache.org/jira/browse/KAFKA-204
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Chris Burroughs
>            Assignee: Chris Burroughs
>            Priority: Critical
>         Attachments: k204-v1.txt
>
>
>   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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-204) BoundedByteBufferReceive hides OutOfMemoryError

Posted by "Taylor Gautier (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13150612#comment-13150612 ] 

Taylor Gautier commented on KAFKA-204:
--------------------------------------

Agree with Jay - if you get an OOME all bets are off.  Best to just exit.
                
> BoundedByteBufferReceive hides OutOfMemoryError
> -----------------------------------------------
>
>                 Key: KAFKA-204
>                 URL: https://issues.apache.org/jira/browse/KAFKA-204
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Chris Burroughs
>            Priority: Critical
>
>   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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-204) BoundedByteBufferReceive hides OutOfMemoryError

Posted by "Jun Rao (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13151297#comment-13151297 ] 

Jun Rao commented on KAFKA-204:
-------------------------------

The main reason this was added is to show the requested size and the caller that triggered such a request. It would be nice if both pieces are logged together. With the new patch, those two pieces are logged separately (although should be close) and someone has to link them together manually.
                
> BoundedByteBufferReceive hides OutOfMemoryError
> -----------------------------------------------
>
>                 Key: KAFKA-204
>                 URL: https://issues.apache.org/jira/browse/KAFKA-204
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Chris Burroughs
>            Assignee: Chris Burroughs
>            Priority: Critical
>         Attachments: k204-v1.txt
>
>
>   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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KAFKA-204) BoundedByteBufferReceive hides OutOfMemoryError

Posted by "Chris Burroughs (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Burroughs updated KAFKA-204:
----------------------------------

    Attachment: k204-v1.txt
    
> BoundedByteBufferReceive hides OutOfMemoryError
> -----------------------------------------------
>
>                 Key: KAFKA-204
>                 URL: https://issues.apache.org/jira/browse/KAFKA-204
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Chris Burroughs
>            Priority: Critical
>         Attachments: k204-v1.txt
>
>
>   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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-204) BoundedByteBufferReceive hides OutOfMemoryError

Posted by "Jun Rao (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13151300#comment-13151300 ] 

Jun Rao commented on KAFKA-204:
-------------------------------

Another possibility is to rethrow a new RuntimeException with OOME wrapped as the cause.
                
> BoundedByteBufferReceive hides OutOfMemoryError
> -----------------------------------------------
>
>                 Key: KAFKA-204
>                 URL: https://issues.apache.org/jira/browse/KAFKA-204
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Chris Burroughs
>            Assignee: Chris Burroughs
>            Priority: Critical
>         Attachments: k204-v1.txt
>
>
>   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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-204) BoundedByteBufferReceive hides OutOfMemoryError

Posted by "Jay Kreps (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13155740#comment-13155740 ] 

Jay Kreps commented on KAFKA-204:
---------------------------------

We have request limits in the server and consumer that should provide protection against this so i think that is the appropriate way to handle it. If it does happen I think we should just break everything and then the person running things should set the configs correctly to limit the max request size the server will accept and the max fetch size for the client.
                
> BoundedByteBufferReceive hides OutOfMemoryError
> -----------------------------------------------
>
>                 Key: KAFKA-204
>                 URL: https://issues.apache.org/jira/browse/KAFKA-204
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Chris Burroughs
>            Assignee: Chris Burroughs
>            Priority: Critical
>         Attachments: k204-v1.txt
>
>
>   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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-204) BoundedByteBufferReceive hides OutOfMemoryError

Posted by "Chris Burroughs (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13151220#comment-13151220 ] 

Chris Burroughs commented on KAFKA-204:
---------------------------------------

Tiny patch for this one case, created KAFKA-205 to follow up.
                
> BoundedByteBufferReceive hides OutOfMemoryError
> -----------------------------------------------
>
>                 Key: KAFKA-204
>                 URL: https://issues.apache.org/jira/browse/KAFKA-204
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Chris Burroughs
>            Assignee: Chris Burroughs
>            Priority: Critical
>         Attachments: k204-v1.txt
>
>
>   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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (KAFKA-204) BoundedByteBufferReceive hides OutOfMemoryError

Posted by "Chris Burroughs (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Burroughs updated KAFKA-204:
----------------------------------

    Assignee: Chris Burroughs
    
> BoundedByteBufferReceive hides OutOfMemoryError
> -----------------------------------------------
>
>                 Key: KAFKA-204
>                 URL: https://issues.apache.org/jira/browse/KAFKA-204
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Chris Burroughs
>            Assignee: Chris Burroughs
>            Priority: Critical
>         Attachments: k204-v1.txt
>
>
>   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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (KAFKA-204) BoundedByteBufferReceive hides OutOfMemoryError

Posted by "Jay Kreps (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/KAFKA-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13150590#comment-13150590 ] 

Jay Kreps commented on KAFKA-204:
---------------------------------

Uh...does anyone know what the motivation of this was originally? Catching OutOfMemoryError is a bit unorthodox...
                
> BoundedByteBufferReceive hides OutOfMemoryError
> -----------------------------------------------
>
>                 Key: KAFKA-204
>                 URL: https://issues.apache.org/jira/browse/KAFKA-204
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Chris Burroughs
>            Priority: Critical
>
>   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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (KAFKA-204) BoundedByteBufferReceive hides OutOfMemoryError

Posted by "Jun Rao (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jun Rao resolved KAFKA-204.
---------------------------

       Resolution: Fixed
    Fix Version/s: 0.7.1

Just committed this.
                
> BoundedByteBufferReceive hides OutOfMemoryError
> -----------------------------------------------
>
>                 Key: KAFKA-204
>                 URL: https://issues.apache.org/jira/browse/KAFKA-204
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.7
>            Reporter: Chris Burroughs
>            Assignee: Chris Burroughs
>            Priority: Critical
>             Fix For: 0.7.1
>
>         Attachments: k204-v1.txt
>
>
>   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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira