[ 
https://issues.apache.org/jira/browse/KAFKA-1577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14123543#comment-14123543
 ] 

Joel Koshy commented on KAFKA-1577:
-----------------------------------

I think the main reason to allow the exception (as opposed to an existence 
check) is that it should never happen. If it does, then it is a bug and we need 
to know about it. We can either receive a runtime exception or do an existence 
check and log an error. There are a number of places elsewhere in the code 
where we expect keys to be present. If not it is a (potentially serious) bug - 
we would rather let an exception be thrown rather than do an existence check 
and log an error especially if it is a serious issue. In this case we traced 
the cause of this occurrence to a race condition that only happens during 
shutdown which is why swallowing at that point is reasonable since that is the 
only circumstance under which a missing key is possible (and okay). Going 
forward, if the exception shows up anytime other than shutdown then we will 
need to again debug why that is the case and fix it - e.g., if it is related to 
the same race condition then we should fix that race condition.

> Exception in ConnectionQuotas while shutting down
> -------------------------------------------------
>
>                 Key: KAFKA-1577
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1577
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>            Reporter: Joel Koshy
>            Assignee: Sriharsha Chintalapani
>              Labels: newbie
>         Attachments: KAFKA-1577.patch, KAFKA-1577_2014-08-20_19:57:44.patch, 
> KAFKA-1577_2014-08-26_07:33:13.patch, 
> KAFKA-1577_check_counter_before_decrementing.patch
>
>
> {code}
> [2014-08-07 19:38:08,228] ERROR Uncaught exception in thread 
> 'kafka-network-thread-9092-0': (kafka.utils.Utils$)
> java.util.NoSuchElementException: None.get
>         at scala.None$.get(Option.scala:185)
>         at scala.None$.get(Option.scala:183)
>         at kafka.network.ConnectionQuotas.dec(SocketServer.scala:471)
>         at kafka.network.AbstractServerThread.close(SocketServer.scala:158)
>         at kafka.network.AbstractServerThread.close(SocketServer.scala:150)
>         at kafka.network.AbstractServerThread.closeAll(SocketServer.scala:171)
>         at kafka.network.Processor.run(SocketServer.scala:338)
>         at java.lang.Thread.run(Thread.java:662)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to