File tree Expand file tree Collapse file tree
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -740,26 +740,19 @@ private void checkPropertySize(int propertyLength, String propertyName) {
740740
741741 public void syncWait () {
742742 // This method is just called by tests
743- /*
744- * For ephemeral tasks (negative ID), directly wait on the Future.
745- * Ephemeral tasks are not saved to DB, so we can't query them by ID.
746- * Since HugeTask extends FutureTask, we can directly wait for completion.
747- */
748- if (this .id ().asLong () < 0 ) {
749- try {
750- this .get ();
751- } catch (Exception e ) {
752- throw new HugeException ("Failed to wait for task '%s' completed" ,
753- e , this .id );
754- }
755- return ;
756- }
757-
758- // For normal tasks, wait through scheduler
759743 HugeTask <?> task = null ;
760744 try {
761745 task = this .scheduler ().waitUntilTaskCompleted (this .id ());
762746 } catch (Throwable e ) {
747+ if (this .callable () instanceof EphemeralJob &&
748+ e .getClass () == NotFoundException .class &&
749+ e .getMessage ().contains ("Can't find task with id" )) {
750+ /*
751+ * The task with EphemeralJob won't saved in backends and
752+ * will be removed from memory when completed
753+ */
754+ return ;
755+ }
763756 throw new HugeException ("Failed to wait for task '%s' completed" ,
764757 e , this .id );
765758 }
You can’t perform that action at this time.
0 commit comments