You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "Pengzna (via GitHub)" <gi...@apache.org> on 2024/11/29 04:58:49 UTC
[PR] Procedure: Fix procedure framework data race [iotdb]
Pengzna opened a new pull request, #14250:
URL: https://github.com/apache/iotdb/pull/14250
as title.
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Procedure: Fix procedure framework data race [iotdb]
Posted by "wangchao316 (via GitHub)" <gi...@apache.org>.
wangchao316 commented on code in PR #14250:
URL: https://github.com/apache/iotdb/pull/14250#discussion_r1864165660
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/ProcedureExecutor.java:
##########
@@ -329,68 +331,79 @@ private void executeProcedure(Procedure<Env> proc) {
LOG.warn("Rollback stack is null for {}", proc.getProcId());
return;
}
- do {
- if (!rootProcStack.acquire()) {
- if (rootProcStack.setRollback()) {
- switch (executeRootStackRollback(rootProcId, rootProcStack)) {
- case LOCK_ACQUIRED:
- break;
- case LOCK_EVENT_WAIT:
- LOG.info("LOCK_EVENT_WAIT rollback " + proc);
- rootProcStack.unsetRollback();
- break;
- case LOCK_YIELD_WAIT:
- rootProcStack.unsetRollback();
- scheduler.yield(proc);
- break;
- default:
- throw new UnsupportedOperationException();
- }
- } else {
- if (!proc.wasExecuted()) {
- switch (executeRollback(proc)) {
+ ProcedureLockState lockState = null;
+ try {
+ do {
+ if (!rootProcStack.acquire()) {
+ if (rootProcStack.setRollback()) {
+ lockState = executeRootStackRollback(rootProcId, rootProcStack);
+ switch (lockState) {
case LOCK_ACQUIRED:
break;
case LOCK_EVENT_WAIT:
- LOG.info("LOCK_EVENT_WAIT can't rollback child running for {}", proc);
+ LOG.info("LOCK_EVENT_WAIT rollback " + proc);
Review Comment:
print use {}
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Procedure: Fix procedure framework data race [iotdb]
Posted by "Pengzna (via GitHub)" <gi...@apache.org>.
Pengzna commented on code in PR #14250:
URL: https://github.com/apache/iotdb/pull/14250#discussion_r1867199812
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/ProcedureExecutor.java:
##########
@@ -329,68 +331,79 @@ private void executeProcedure(Procedure<Env> proc) {
LOG.warn("Rollback stack is null for {}", proc.getProcId());
return;
}
- do {
- if (!rootProcStack.acquire()) {
- if (rootProcStack.setRollback()) {
- switch (executeRootStackRollback(rootProcId, rootProcStack)) {
- case LOCK_ACQUIRED:
- break;
- case LOCK_EVENT_WAIT:
- LOG.info("LOCK_EVENT_WAIT rollback " + proc);
- rootProcStack.unsetRollback();
- break;
- case LOCK_YIELD_WAIT:
- rootProcStack.unsetRollback();
- scheduler.yield(proc);
- break;
- default:
- throw new UnsupportedOperationException();
- }
- } else {
- if (!proc.wasExecuted()) {
- switch (executeRollback(proc)) {
+ ProcedureLockState lockState = null;
+ try {
+ do {
+ if (!rootProcStack.acquire()) {
+ if (rootProcStack.setRollback()) {
+ lockState = executeRootStackRollback(rootProcId, rootProcStack);
+ switch (lockState) {
case LOCK_ACQUIRED:
break;
case LOCK_EVENT_WAIT:
- LOG.info("LOCK_EVENT_WAIT can't rollback child running for {}", proc);
+ LOG.info("LOCK_EVENT_WAIT rollback " + proc);
Review Comment:
fixed
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Procedure: Fix procedure framework data race [iotdb]
Posted by "OneSizeFitsQuorum (via GitHub)" <gi...@apache.org>.
OneSizeFitsQuorum merged PR #14250:
URL: https://github.com/apache/iotdb/pull/14250
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org