New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IGNITE-14625 #9037
IGNITE-14625 #9037
Conversation
SimpleTask t = new SimpleTask("t"); | ||
IgniteInternalFuture<Void> execAsyncFut = execAsync(n, t, false); | ||
|
||
t.onExecFut.get(getTestTimeout()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't getTestTimeout()
too big for this case? I suggest to replace it with another, small timeout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this timeout will show that something is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, if something goes wrong, test will fail faster.
...c/test/java/org/apache/ignite/internal/processors/localtask/ObservingCheckpointListener.java
Outdated
Show resolved
Hide resolved
...c/test/java/org/apache/ignite/internal/processors/localtask/ObservingCheckpointListener.java
Outdated
Show resolved
Hide resolved
...org/apache/ignite/internal/processors/localtask/DurableBackgroundTasksProcessorSelfTest.java
Outdated
Show resolved
Hide resolved
@Override public IgniteInternalFuture<DurableBackgroundTaskResult> executeAsync(GridKernalContext ctx) { | ||
log = ctx.log(this.getClass()); | ||
|
||
assert worker == null; | ||
|
||
GridFutureAdapter<DurableBackgroundTaskResult> fut = new GridFutureAdapter<>(); | ||
|
||
worker = new GridWorker( | ||
ctx.igniteInstanceName(), | ||
"async-durable-background-task-executor-" + name(), | ||
log | ||
) { | ||
/** {@inheritDoc} */ | ||
@Override protected void body() throws InterruptedException, IgniteInterruptedCheckedException { | ||
try { | ||
execute(ctx); | ||
|
||
worker = null; | ||
|
||
fut.onDone(DurableBackgroundTaskResult.complete(null)); | ||
} | ||
catch (Throwable t) { | ||
worker = null; | ||
|
||
fut.onDone(DurableBackgroundTaskResult.restart(t)); | ||
} | ||
} | ||
}; | ||
|
||
new IgniteThread(worker).start(); | ||
|
||
return fut; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that this method could be common for any tasks, shouldn't we move it to DurableBackgroundTasksProcessor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be done as needed.
...g/apache/ignite/internal/cache/query/index/sorted/DurableBackgroundCleanupIndexTreeTask.java
Outdated
Show resolved
Hide resolved
...g/apache/ignite/internal/cache/query/index/sorted/DurableBackgroundCleanupIndexTreeTask.java
Outdated
Show resolved
Hide resolved
...g/apache/ignite/internal/cache/query/index/sorted/DurableBackgroundCleanupIndexTreeTask.java
Show resolved
Hide resolved
log.info("Executing durable background task: " + task.shortName()); | ||
/** {@inheritDoc} */ | ||
@Override public void onMarkCheckpointBegin(Context ctx) { | ||
for (Iterator<Entry<String, DurableBackgroundTaskState>> it = tasks.entrySet().iterator(); it.hasNext(); ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any locks here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not scary if part of the task is completed a little later, since then they will definitely be deleted at the next checkpoint.
...in/java/org/apache/ignite/internal/processors/localtask/DurableBackgroundTasksProcessor.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/ignite/internal/processors/localtask/DurableBackgroundTasksProcessor.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/ignite/internal/processors/localtask/DurableBackgroundTasksProcessor.java
Show resolved
Hide resolved
...in/java/org/apache/ignite/internal/processors/localtask/DurableBackgroundTasksProcessor.java
Show resolved
Hide resolved
...in/java/org/apache/ignite/internal/processors/localtask/DurableBackgroundTasksProcessor.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/ignite/internal/processors/localtask/DurableBackgroundTasksProcessor.java
Outdated
Show resolved
Hide resolved
...org/apache/ignite/internal/processors/localtask/DurableBackgroundTasksProcessorSelfTest.java
Show resolved
Hide resolved
… issue when checkpointer could preemptively delete completed task, potentially causing leaks. (apache#9037)
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
The Contribution Checklist
The description explains WHAT and WHY was made instead of HOW.
The following pattern must be used:
IGNITE-XXXX Change summary
whereXXXX
- number of JIRA issue.(see the Maintainers list)
the
green visa
attached to the JIRA ticket (see TC.Bot: Check PR)Notes
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.