ayushtkn commented on a change in pull request #2789:
URL: https://github.com/apache/hive/pull/2789#discussion_r751353413



##########
File path: 
hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java
##########
@@ -1417,10 +1426,27 @@ private void process(NotificationEvent event, 
ListenerEvent listenerEvent) throw
       setTimeToLive(MetastoreConf.getTimeVar(conf, ttlConf, TimeUnit.SECONDS));
       setCleanupInterval(
           MetastoreConf.getTimeVar(conf, 
ConfVars.EVENT_DB_LISTENER_CLEAN_INTERVAL, TimeUnit.MILLISECONDS));
+      setWaitInterval(MetastoreConf
+          .getTimeVar(conf, EVENT_DB_LISTENER_CLEAN_STARTUP_WAIT_INTERVAL, 
TimeUnit.MILLISECONDS));
     }
 
     @Override
     public void run() {
+      LOG.info("Wait interval is {}", waitInterval);
+      if (waitInterval > 0) {
+        try {
+          LOG.info("Cleaner Thread Restarted and {} or {} is configured. So 
cleaner thread will startup post waiting "
+                  + "{} ms", EVENT_DB_LISTENER_CLEAN_STARTUP_WAIT_INTERVAL,
+              EVENT_DB_LISTENER_CLEAN_STARTUP_WAIT_INTERVAL.getHiveName(), 
waitInterval);
+          Thread.sleep(waitInterval);
+        } catch (InterruptedException e) {
+          LOG.error("Failed during the initial wait before start.", e);
+          Thread.currentThread().interrupt();

Review comment:
       As discussed, Have wrapped this isTest check

##########
File path: 
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java
##########
@@ -752,6 +752,9 @@ public static ConfVars getMetaConf(String name) {
     
EVENT_DB_LISTENER_CLEAN_INTERVAL("metastore.event.db.listener.clean.interval",
             "hive.metastore.event.db.listener.clean.interval", 7200, 
TimeUnit.SECONDS,
             "sleep interval between each run for cleanup of events from the 
database listener queue"),
+    
EVENT_DB_LISTENER_CLEAN_STARTUP_WAIT_INTERVAL("metastore.event.db.listener.clean.startup.wait.interval",
+        "hive.metastore.event.db.listener.clean.startup.wait.interval", 1, 
TimeUnit.DAYS,
+        "wait interval post start of Cleaner thread after which the cleaner 
thread starts to work"),

Review comment:
       Done




-- 
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to