Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 96715200CD8 for ; Wed, 2 Aug 2017 10:46:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 94E28168FEC; Wed, 2 Aug 2017 08:46:22 +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 DB3C6168FEA for ; Wed, 2 Aug 2017 10:46:21 +0200 (CEST) Received: (qmail 77337 invoked by uid 500); 2 Aug 2017 08:46:21 -0000 Mailing-List: contact dev-help@atlas.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@atlas.apache.org Delivered-To: mailing list dev@atlas.apache.org Received: (qmail 77325 invoked by uid 99); 2 Aug 2017 08:46:20 -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, 02 Aug 2017 08:46:20 +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 42A721A1D0F; Wed, 2 Aug 2017 08:46:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3 X-Spam-Level: *** X-Spam-Status: No, score=3 tagged_above=-999 required=6.31 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.001] 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 HhED7HJ0SFjG; Wed, 2 Aug 2017 08:46:18 +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 772B35F340; Wed, 2 Aug 2017 08:46:18 +0000 (UTC) Received: from reviews.apache.org (unknown [10.41.0.12]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 172D0E044C; Wed, 2 Aug 2017 08:46:18 +0000 (UTC) Received: from reviews-vm2.apache.org (localhost [IPv6:::1]) by reviews.apache.org (ASF Mail Server at reviews-vm2.apache.org) with ESMTP id 7A647C400D8; Wed, 2 Aug 2017 08:46:15 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============4697778293896933868==" MIME-Version: 1.0 Subject: Re: Review Request 61274: ATLAS-1944 - Fix for ConcurrentModificationException Exception in HookConsumer (KafkaConsumer) while stopping Atlas server From: Nixon Rodrigues To: Apoorv Naik , Madhan Neethiraj , Ashutosh Mestry , Sarath Subramanian Cc: atlas , Nixon Rodrigues Date: Wed, 02 Aug 2017 08:46:15 -0000 Message-ID: <20170802084615.16836.14547@reviews-vm2.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Nixon Rodrigues X-ReviewGroup: atlas X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/61274/ X-Sender: Nixon Rodrigues References: <20170801162535.55967.90593@reviews-vm2.apache.org> In-Reply-To: <20170801162535.55967.90593@reviews-vm2.apache.org> Reply-To: Nixon Rodrigues X-ReviewRequest-Repository: atlas archived-at: Wed, 02 Aug 2017 08:46:22 -0000 --===============4697778293896933868== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On Aug. 1, 2017, 4:25 p.m., Apoorv Naik wrote: > > webapp/src/main/java/org/apache/atlas/notification/NotificationHookConsumer.java > > Lines 221 (patched) > > > > > > LOG.info => LOG.debug Apoorv, this is logged one time and can be helpfull to know if consumer has started, so i am keeping it. - Nixon ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/61274/#review181900 ----------------------------------------------------------- On Aug. 1, 2017, 11:07 a.m., Nixon Rodrigues wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/61274/ > ----------------------------------------------------------- > > (Updated Aug. 1, 2017, 11:07 a.m.) > > > Review request for atlas, Apoorv Naik, Ashutosh Mestry, Madhan Neethiraj, and Sarath Subramanian. > > > Bugs: ATLAS-1944 > https://issues.apache.org/jira/browse/ATLAS-1944 > > > Repository: atlas > > > Description > ------- > > Background:- NotificationHookConsumer was throwing ConcurrentModificationException exception while shutting down the consumer thread. The stop method of thread was calling the kafkacosumer.stop method while in run method of HookConsumer which is busy in cosuming the kafka message by polling kafka server. This simaltanous action of stoping and polling causes ConcurrentModificationException. > > Fix:- > > * Added try finally block in run method which wraps the while loop and when loop ends the finally blocks calls the consumer close method is called which ensures that close is called after consuming is ended. > > * Replaced the ShutdownThread interface which was delaying the shutdown process of consumer with Runnable interface used earlier. > > > Reference : - https://kafka.apache.org/090/javadoc/index.html?org/apache/kafka/clients/consumer/KafkaConsumer.html > > > Diffs > ----- > > notification/src/main/java/org/apache/atlas/kafka/AtlasKafkaConsumer.java d431176 > notification/src/main/java/org/apache/atlas/notification/NotificationConsumer.java 0bd75e1 > notification/src/test/java/org/apache/atlas/notification/AbstractNotificationConsumerTest.java bcee00c > webapp/src/main/java/org/apache/atlas/notification/NotificationHookConsumer.java b8255b3 > > > Diff: https://reviews.apache.org/r/61274/diff/1/ > > > Testing > ------- > > Tested the Atlas kafkaconsumer from hive hook and shutdown of atlas server to check if there is issue while shutdown process. > Unit test and integration test are passing. > > > Thanks, > > Nixon Rodrigues > > --===============4697778293896933868==--