From jira-return-9662-archive-asf-public=cust-asf.ponee.io@kafka.apache.org Wed Feb 7 05:15:05 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 7C204180657 for ; Wed, 7 Feb 2018 05:15:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6B539160C46; Wed, 7 Feb 2018 04:15:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B181D160C45 for ; Wed, 7 Feb 2018 05:15:04 +0100 (CET) Received: (qmail 78352 invoked by uid 500); 7 Feb 2018 04:15:03 -0000 Mailing-List: contact jira-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@kafka.apache.org Delivered-To: mailing list jira@kafka.apache.org Received: (qmail 78336 invoked by uid 99); 7 Feb 2018 04:15:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Feb 2018 04:15:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id D795D1A046F for ; Wed, 7 Feb 2018 04:15:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -101.511 X-Spam-Level: X-Spam-Status: No, score=-101.511 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id M752_1ud0jGf for ; Wed, 7 Feb 2018 04:15:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 750F75F232 for ; Wed, 7 Feb 2018 04:15:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id BF4EFE0257 for ; Wed, 7 Feb 2018 04:15:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 2716E240F6 for ; Wed, 7 Feb 2018 04:15:00 +0000 (UTC) Date: Wed, 7 Feb 2018 04:15:00 +0000 (UTC) From: "Ewen Cheslack-Postava (JIRA)" To: jira@kafka.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (KAFKA-6490) JSON SerializationException Stops Connect MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KAFKA-6490?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1635= 4945#comment-16354945 ]=20 Ewen Cheslack-Postava commented on KAFKA-6490: ---------------------------------------------- A change in behavior like that would definitely require a KIP =E2=80=93 exi= sting users would not expect this at all. Connect started with the current behavior because for many users losing dat= a is worse than suffering some downtime. However, it's clear some alternati= ves are warranted; this question comes up from time to time on mailing list= s. Generally there are only a few options that seem to make sense: * Stop processing (current behavior) and log * Log and retry (really only makes sense for unusual edge cases where data= got corrupted in flight between Kafka and Connect) * Discard and log (I care about uptime more than a bit of lost data) * Dead letter queue (or some other fallback handler) The retry case is probably the least important here as it will rarely make = a difference, so the other 3 are the ones I think we'd want to implement. A= KIP for this should be straightforward, though the implementation will req= uire care to make sure we handle all places errors can occur (in the produc= er/consumer, during deserialization, during transformations, etc). > JSON SerializationException Stops Connect > ----------------------------------------- > > Key: KAFKA-6490 > URL: https://issues.apache.org/jira/browse/KAFKA-6490 > Project: Kafka > Issue Type: Bug > Components: KafkaConnect > Affects Versions: 1.0.0 > Reporter: William R. Speirs > Priority: Major > Attachments: KAFKA-6490_v1.patch > > > If you configure KafkaConnect to parse JSON messages, and you send it a n= on-JSON message, the=C2=A0SerializationException message will bubble up to = the top, and stop KafkaConnect. While I understand sending non-JSON to a JS= ON serializer is a bad idea, I think that a single malformed message=C2=A0s= topping all of KafkaConnect is even worse. > The data exception is thrown here: [https://github.com/apache/kafka/blob/= trunk/connect/json/src/main/java/org/apache/kafka/connect/json/JsonConverte= r.java#L305] > =C2=A0 > From the call here: [https://github.com/apache/kafka/blob/trunk/connect/r= untime/src/main/java/org/apache/kafka/connect/runtime/WorkerSinkTask.java#L= 476] > This bubbles all the way up to the top, and KafkaConnect simply stops wit= h the message: {{ERROR WorkerSinkTask\{id=3Delasticsearch-sink-0} Task thre= w an uncaught and unrecoverable exception (org.apache.kafka.connect.runtime= .WorkerTask:172)}} > Thoughts on adding a {{try/catch}} around the {{for}} loop in WorkerSinkT= ask's {{convertMessages}} so messages that don't properly parse are logged,= but simply ignored? This way KafkaConnect can keep working even when it en= counters a message it cannot decode? -- This message was sent by Atlassian JIRA (v7.6.3#76005)