-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Fix some problems with restoring #2141
Conversation
gianm
commented
Dec 22, 2015
- TaskLockbox should consider active tasks active even if they have no locks.
- Shedding locks at startup is bad, we actually want to keep them. Stop doing that.
- stopGracefully now interrupts the run thread if had started running finishJob. This avoids waiting for handoff unnecessarily.
👍 |
|
||
if (finishingJob) { | ||
plumber.finishJob(); | ||
} | ||
} | ||
} | ||
catch (Exception e) { |
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.
should we check if we were asked to stop before firing an alert while handling exception ?
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.
hmm, maybe only ignore it if we get an InterruptedException? other exceptions are probably worth reporting.
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.
sounds good.
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.
updated
// them if we actually need them | ||
for (final TaskLock taskLock : getTaskLocks(toolbox)) { | ||
toolbox.getTaskActionClient().submit(new LockReleaseAction(taskLock.getInterval())); | ||
} |
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.
wondering if its better to not release locks only if task is restorable ?
will it be better to always release old locks if there are any in case the task is not restorable (just to be on safer side)?
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 don't think there is a reason to release locks here since,
- we won't have any when we first start up (since a while ago, tasks don't get retried if they fail)
- after a second startup (restore) we really do want to keep the locks as dropping them will confuse us
8e6827e
to
02f85fb
Compare
@gianm this has conflicts now |
- Shedding locks at startup is bad, we actually want to keep them. Stop doing that. - stopGracefully now interrupts the run thread if had started running finishJob. This avoids waiting for handoff unnecessarily.
02f85fb
to
32edd15
Compare
@fjy fixed |
log.info("Gracefully stopping."); | ||
if (isFirehoseDrainableByClosing(spec.getIOConfig().getFirehoseFactory())) { | ||
if (!gracefullyStopped) { | ||
gracefullyStopped = true; |
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.
what happened to the log line?
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.
It split in two and moved into the conditional below.
👍 |
Fix some problems with restoring