keith-turner commented on a change in pull request #2467:
URL: https://github.com/apache/accumulo/pull/2467#discussion_r800901600
##########
File path: core/src/main/java/org/apache/accumulo/fate/Fate.java
##########
@@ -71,35 +83,58 @@ public void run() {
try {
tid = store.reserve();
TStatus status = store.getStatus(tid);
+ if (status == FAILED) {
+ runnerLog.info(
+ "FATE txid " + Long.toHexString(tid) + " likely cancelled
before it started.");
+ return;
+ }
Repo<T> op = store.top(tid);
- if (status == TStatus.FAILED_IN_PROGRESS) {
+ if (status == FAILED_IN_PROGRESS) {
processFailed(tid, op);
} else {
Repo<T> prevOp = null;
try {
+ synchronized (RUNNING_TRANSACTIONS) {
+ RUNNING_TRANSACTIONS.put(tid, Thread.currentThread());
+ }
deferTime = op.isReady(tid, environment);
if (deferTime == 0) {
prevOp = op;
- if (status == TStatus.SUBMITTED) {
- store.setStatus(tid, TStatus.IN_PROGRESS);
+ if (status == SUBMITTED) {
+ store.setStatus(tid, IN_PROGRESS);
}
op = op.call(tid, environment);
} else
continue;
} catch (Exception e) {
+ if (e instanceof InterruptedException) {
+ runnerLog.info(
+ "FATE Runner thread interrupted processing txid " +
Long.toHexString(tid));
+ if (prevOp != null) {
+ processFailed(tid, prevOp);
+ }
+ if (op != prevOp) {
+ processFailed(tid, op);
+ }
Review comment:
I was thinking of just not calling processFailed here unless there is a
compelling reason to do so. When the code calls transitionToFailed then it
will eventually call processFailed.
--
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]