tkalkirill commented on a change in pull request #9207:
URL: https://github.com/apache/ignite/pull/9207#discussion_r676652356



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/localtask/DurableBackgroundTasksProcessor.java
##########
@@ -111,9 +111,22 @@ public DurableBackgroundTasksProcessor(GridKernalContext 
ctx) {
                 metaStorage.iterate(
                     TASK_PREFIX,
                     (k, v) -> {
-                        DurableBackgroundTask t = (DurableBackgroundTask)v;
+                        DurableBackgroundTask t = 
((DurableBackgroundTask<?>)v);
+                        DurableBackgroundTask converted = 
t.convertAfterRestoreIfNeeded();
 
-                        tasks.put(t.name(), new DurableBackgroundTaskState(t, 
null, true));
+                        if (t != converted) {
+                            GridFutureAdapter<?> outFut = new 
GridFutureAdapter<>();
+                            outFut.onDone();
+
+                            DurableBackgroundTaskState<?> state = new 
DurableBackgroundTaskState<>(t, outFut, true);
+                            state.state(COMPLETED);
+
+                            tasks.put(t.name(), state);
+
+                            t = converted;
+                        }
+
+                        tasks.put(t.name(), new 
DurableBackgroundTaskState<>(t, new GridFutureAdapter<>(), true));

Review comment:
       I replace the converted task with the one that needs to be added a 
second time.




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