sergehuber commented on code in PR #636: URL: https://github.com/apache/unomi/pull/636#discussion_r1274916077
########## persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java: ########## @@ -1158,6 +1157,45 @@ protected Boolean execute(Object... args) throws Exception { } } + private void startTaskTracker(AbstractBulkByScrollRequest request, TaskSubmissionResponse response) { + logger.info("Start tracking submitted task: [{}]. See debug log level for more information", response.getTask()); + if (logger.isDebugEnabled()) { + logger.debug("Tracking task [{}]: [{}] using query: [{}]", response.getTask(), request.toString(), request.getSearchRequest().source().query()); + } + new InClassLoaderExecute<Void>(metricsService, this.getClass().getName() + ".taskTracker", this.bundleContext, this.fatalIllegalStateErrors, throwExceptions) { + protected Void execute(Object... args) throws Exception { + + TaskId taskId = new TaskId(response.getTask()); + while (true){ Review Comment: Should we add something to get out of the loop after a long time (even hours) ? From what I see if for some reason we don't detect the end of the task we will stay in this loop forever. ########## persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java: ########## @@ -1158,6 +1157,45 @@ protected Boolean execute(Object... args) throws Exception { } } + private void startTaskTracker(AbstractBulkByScrollRequest request, TaskSubmissionResponse response) { Review Comment: May I suggest to rename this method to waitForTask ? With the name start I was expecting to see another system to wait for the ending or for polling for completion. -- 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: dev-unsubscr...@unomi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org