amrishlal commented on a change in pull request #7174:
URL: https://github.com/apache/pinot/pull/7174#discussion_r689233690



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/periodictask/BasePeriodicTask.java
##########
@@ -111,22 +126,47 @@ protected void setUpTask() {
    */
   @Override
   public final void run() {
-    _running = true;
-
-    if (_started) {
-      long startTime = System.currentTimeMillis();
-      LOGGER.info("Start running task: {}", _taskName);
-      try {
-        runTask();
-      } catch (Exception e) {
-        LOGGER.error("Caught exception while running task: {}", _taskName, e);
+    try {
+      // Don't allow a task to run more than once at a time.
+      _runLock.lock();
+      _running = true;
+
+      String periodicTaskRequestId =
+          _activePeriodicTaskProperties != null ? 
_activePeriodicTaskProperties.getProperty(PeriodicTask.PROPERTY_KEY_REQUEST_ID) 
: null;
+      if (_started) {
+        long startTime = System.currentTimeMillis();
+        LOGGER.info("[TaskRequestId: {}] Start running task: {}", 
periodicTaskRequestId, _taskName);

Review comment:
       Fixed.




-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to