atlas-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashutosh Mestry <ames...@hortonworks.com>
Subject Review Request 61665: ATLAS-2047: Exception Thrown by Kafka Consumer Ends up Filling Logs Due to Incorrect Handling
Date Tue, 15 Aug 2017 16:58:51 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/61665/
-----------------------------------------------------------

Review request for atlas, Madhan Neethiraj and Nixon Rodrigues.


Bugs: ATLAS-2047
    https://issues.apache.org/jira/browse/ATLAS-2047


Repository: atlas


Description
-------

Please refer to [ATLAS-2047](https://issues.apache.org/jira/browse/ATLAS-2047) for background
and analysis.

**Implementation**

Please take a look at this scala code. This is _ShutdownableThread_. The thread does the job
of handling all exceptions. Upon exception, it manages the _shutdownLatch_ (from yesterday’s
bug fix) and gets out of the _isRunning_ loop.
```scala
  override def run(): Unit = {
    info("Starting ")
    try{
      while(isRunning.get()){
        doWork()
      }
    } catch{
      case e: Throwable =>
        if(isRunning.get())
          error("Error due to ", e)
    }
    shutdownLatch.countDown()
    info("Stopped ")
  }
```

Moved _try...catch_ block to leave exception handling to _ShutdownableThread_.


Diffs
-----

  webapp/src/main/java/org/apache/atlas/notification/NotificationHookConsumer.java ef64c3b

  webapp/src/test/java/org/apache/atlas/notification/NotificationHookConsumerTest.java a6f58e8



Diff: https://reviews.apache.org/r/61665/diff/1/


Testing
-------

**Unit tests**
Updated unit tests to reproduce the scenarios and verify the fix.

**Functional tests**
Verified regular notification scenarios.


Thanks,

Ashutosh Mestry


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message