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 41427200CD8 for ; Wed, 2 Aug 2017 10:46:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3FCB7168FFB; Wed, 2 Aug 2017 08:46:45 +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 8575B168FFA for ; Wed, 2 Aug 2017 10:46:44 +0200 (CEST) Received: (qmail 77978 invoked by uid 500); 2 Aug 2017 08:46:43 -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 77967 invoked by uid 99); 2 Aug 2017 08:46:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Aug 2017 08:46:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id D37BCC1728; Wed, 2 Aug 2017 08:46:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-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 (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Un_qPbtPmXuV; Wed, 2 Aug 2017 08:46:41 +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 3D9345FB2C; Wed, 2 Aug 2017 08:46:41 +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 E4E11E044C; Wed, 2 Aug 2017 08:46:39 +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 CE264C400D8; Wed, 2 Aug 2017 08:46:39 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============4320098208729535388==" 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:39 -0000 Message-ID: <20170802084639.16836.56@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: <20170801201229.55935.40099@reviews-vm2.apache.org> In-Reply-To: <20170801201229.55935.40099@reviews-vm2.apache.org> Reply-To: Nixon Rodrigues X-ReviewRequest-Repository: atlas archived-at: Wed, 02 Aug 2017 08:46:45 -0000 --===============4320098208729535388== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On Aug. 1, 2017, 8:12 p.m., Ashutosh Mestry wrote: > > Can you please let me know the testing performed to verify this. I am little hesitent because this removes _ShutdownableThread_. > > > > See attached my patch that merely calls _shutdown_ on consumer thread. I have done some testing on this and did not see the problems we had seen before. With calling consumer.stop(); there timeout in thread shutdown with message in log "Timed out waiting for consumer threads to shut down, exiting uncleanly" But after Adding extended HookConsumer from ShutdownableThread and calling consumer.shutdown(), closing of kafkaconsumer was happening fine before timeout of consumer thread.Now added back the ShutdownableThread implementation. - Nixon ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/61274/#review181916 ----------------------------------------------------------- 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 > > --===============4320098208729535388==--