mneethiraj commented on code in PR #1231:
URL: https://github.com/apache/ranger/pull/1231#discussion_r4353957784


##########
audit-server/audit-dispatcher/dispatcher-common/src/main/java/org/apache/ranger/audit/dispatcher/kafka/AuditDispatcherBase.java:
##########
@@ -301,6 +355,44 @@ public void run() {
             }
         }
 
+        private boolean handlePollException(Exception e) {
+            if (e instanceof WakeupException) {
+                if (!running.get()) {
+                    LOG.info("WakeupException in {} dispatcher worker '{}' 
during shutdown", getDispatcherName(), workerId);
+                    return false;
+                }
+                LOG.error("WakeupException in {} dispatcher worker '{}'", 
getDispatcherName(), workerId, e);
+                return true;
+            } else if (e instanceof InterruptException) {
+                if (!running.get()) {
+                    LOG.info("InterruptException in {} dispatcher worker '{}' 
during shutdown", getDispatcherName(), workerId);
+                    return false;

Review Comment:
   Shouldn't `Thread.currentThread().interrupt();` be called from here as well, 
similar to line 372? If yes, consider following update:
   
   ```
   if (!running.get()) {
     LOG.info("InterruptException in {} dispatcher worker '{}' during 
shutdown", getDispatcherName(), workerId);
   } else {
     LOG.error("InterruptException in {} dispatcher worker '{}'", 
getDispatcherName(), workerId, e);
   }
   
   Thread.currentThread().interrupt();
   
   return false;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to