Skip to content

Commit

Permalink
[to rc/1.3.3] Make procedure scheduler ignore successful procedure (#…
Browse files Browse the repository at this point in the history
…13330)

* we just ignore it, ok?

* don't add back successful procedure
  • Loading branch information
liyuheng55555 authored Aug 29, 2024
1 parent 213ea7c commit 61b7d58
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public void deserialize(ByteBuffer byteBuffer) {
byte[] resultArr = new byte[resultLen];
byteBuffer.get(resultArr);
}
// has lock
// has lock
if (byteBuffer.get() == 1) {
this.lockedWhenLoading();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,11 @@ private void executeProcedure(Procedure<Env> proc) {
* @param proc procedure
*/
private void executeProcedure(RootProcedureStack rootProcStack, Procedure<Env> proc) {
Preconditions.checkArgument(
proc.getState() == ProcedureState.RUNNABLE, "NOT RUNNABLE! " + proc);
if (proc.getState() != ProcedureState.RUNNABLE) {
LOG.error(
"The executing procedure should in RUNNABLE state, but it's not. Procedure is {}", proc);
return;
}
boolean suspended = false;
boolean reExecute;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ public void signalAll() {

@Override
public void addFront(final Procedure procedure) {
if (procedure.isSuccess()) {
LOG.warn("Don't add a successful procedure back to the scheduler, it will be ignored");
return;
}
push(procedure, true, true);
}

Expand All @@ -88,6 +92,10 @@ public void addFront(final Procedure procedure, boolean notify) {

@Override
public void addBack(final Procedure procedure) {
if (procedure.isSuccess()) {
LOG.warn("Don't add a successful procedure back to the scheduler, it will be ignored");
return;
}
push(procedure, false, true);
}

Expand Down

0 comments on commit 61b7d58

Please sign in to comment.