From dev-return-105723-archive-asf-public=cust-asf.ponee.io@kafka.apache.org Mon Jul 15 16:42:04 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id BC8B5180595 for ; Mon, 15 Jul 2019 18:42:03 +0200 (CEST) Received: (qmail 37066 invoked by uid 500); 15 Jul 2019 16:42:01 -0000 Mailing-List: contact dev-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list dev@kafka.apache.org Received: (qmail 36803 invoked by uid 99); 15 Jul 2019 16:42:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jul 2019 16:42:01 +0000 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 66839E1025 for ; Mon, 15 Jul 2019 16:42: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 21ACE2658C for ; Mon, 15 Jul 2019 16:42:00 +0000 (UTC) Date: Mon, 15 Jul 2019 16:42:00 +0000 (UTC) From: "Chris Cranford (JIRA)" To: dev@kafka.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (KAFKA-8665) WorkerSourceTask race condition when rebalance occurs before task has started MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Chris Cranford created KAFKA-8665: ------------------------------------- Summary: WorkerSourceTask race condition when rebalance occurs= before task has started Key: KAFKA-8665 URL: https://issues.apache.org/jira/browse/KAFKA-8665 Project: Kafka Issue Type: Bug Components: KafkaConnect Affects Versions: 2.2.0 Reporter: Chris Cranford In our project we have several {{SourceTask}} implementations that perform = a set of sequential steps in the {{SourceTask#start}} call.=C2=A0 It's poss= ible that during these sequential operations, a=C2=A0rebalance occurs which= leads to the situation where the {{WorkerSourceTask}} transitions to the s= tate where {{startedShutdownBeforeStartCompleted=3Dtrue}} and then the runt= ime starts a brand new task. This is mostly a problem around specific named resources that are registere= d when a call to {{SourceTask#start}} happens and those same resources are = unregistered later when the call to {{SourceTask#stop}} occurs.=C2=A0 For us specifically, this is a problem with JMX resource registration/unreg= istration.=C2=A0 We register those beans at the end of the call to {{Source= Task#start}} and unregister in the call to {{stop}}.=C2=A0 Due to the order= of start/stop pairs combined with where a rebalance is triggered, this lea= ds to=C2=A0 # Register JMX beans when SourceTask A1 is started. # Register JMX beans when SourceTask A2 is started with rebalance. ## JMX beans failed to register as they're already registered. # SourceTask A1 finally stops, triggers unregistering JMX beans =C2=A0 In our use case we're experiencing a problem with the registration/unregist= ration of JMX resources with the nature of how a rebalance is triggered whi= le the task hasn't yet fully started and never gets stopped -- This message was sent by Atlassian JIRA (v7.6.14#76016)