You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by gu...@apache.org on 2019/01/15 18:19:14 UTC

[kafka] branch trunk updated: MINOR: Add log entry for KafkaException in StreamThread#runLoop (#6144)

This is an automated email from the ASF dual-hosted git repository.

guozhang pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 3dffd5d  MINOR: Add log entry for KafkaException in StreamThread#runLoop (#6144)
3dffd5d is described below

commit 3dffd5df2f7d4a8a3e512be5af908328c9d5e92e
Author: Guozhang Wang <wa...@gmail.com>
AuthorDate: Tue Jan 15 10:19:03 2019 -0800

    MINOR: Add log entry for KafkaException in StreamThread#runLoop (#6144)
    
    I've observed several reports of sudden unexpected streamthread shutdown with the log entry like:
    
    State transition from PENDING_SHUTDOWN to DEAD
    
    but there is no related error logs before this line at all. I suspect this is because we intentionally do not log for KafkaException and there's some edge cases where we miss internally and hence caused this. I'm adding the ERROR level log entry here in order to reveal more information in case I saw this again in the future.
    
    Reviewers: Matthias J. Sax <ma...@confluent.io>
---
 .../org/apache/kafka/streams/processor/internals/StreamThread.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java b/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java
index a8db7e8..8511873 100644
--- a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java
+++ b/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java
@@ -754,7 +754,8 @@ public class StreamThread extends Thread {
             runLoop();
             cleanRun = true;
         } catch (final KafkaException e) {
-            // just re-throw the exception as it should be logged already
+            log.error("Encountered the following unexpected Kafka exception during processing, " +
+                "this usually indicate Streams internal errors:", e);
             throw e;
         } catch (final Exception e) {
             // we have caught all Kafka related exceptions, and other runtime exceptions