ascherbakoff commented on code in PR #2321:
URL: https://github.com/apache/ignite-3/pull/2321#discussion_r1277222777


##########
modules/raft/src/main/java/org/apache/ignite/raft/jraft/core/NodeImpl.java:
##########
@@ -1857,36 +1856,30 @@ public void apply(final Task task) {
 
         final LogEntry entry = new LogEntry();
         entry.setData(task.getData());
-        int retryTimes = 0;
-        try {
-            final EventTranslator<LogEntryAndClosure> translator = (event, 
sequence) -> {
-                event.reset();
-                event.nodeId = getNodeId();
-                event.done = task.getDone();
-                event.entry = entry;
-                event.expectedTerm = task.getExpectedTerm();
-            };
-            while (true) {
-                if (this.applyQueue.tryPublishEvent(translator)) {
-                    break;
-                }
-                else {
-                    retryTimes++;
-                    if (retryTimes > MAX_APPLY_RETRY_TIMES) {
-                        
Utils.runClosureInThread(this.getOptions().getCommonExecutor(), task.getDone(),
-                            new Status(RaftError.EBUSY, "Node is busy, has too 
many tasks."));
-                        LOG.warn("Node {} applyQueue is overload.", 
getNodeId());
-                        this.metrics.recordTimes("apply-task-overload-times", 
1);
-                        return;
+
+        final EventTranslator<LogEntryAndClosure> translator = (event, 
sequence) -> {
+            event.reset();
+            event.nodeId = getNodeId();
+            event.done = task.getDone();
+            event.entry = entry;
+            event.expectedTerm = task.getExpectedTerm();
+        };
+        switch (this.options.getApplyTaskMode()) {
+            case Blocking:

Review Comment:
   It is forbidden to use blocking code in Ignite worker threads. The patch 
adds retries on a busy state, this should be enough. It seems a blocking mode 
will never be used.



-- 
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]

Reply via email to