mirror of
https://github.com/apache/nifi.git
synced 2025-02-09 11:35:05 +00:00
NIFI-10772 Clarify logs on shutdown where controller service and/or
processor were unable to properly start Signed-off-by: Matthew Burgess <mattyb149@apache.org> This closes #6829
This commit is contained in:
parent
0d9dc6c540
commit
fe25424233
@ -105,6 +105,7 @@ import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
@ -1799,8 +1800,15 @@ public class StandardProcessorNode extends ProcessorNode implements Connectable
|
||||
return null;
|
||||
};
|
||||
|
||||
// Trigger the task in a background thread.
|
||||
final Future<?> taskFuture = schedulingAgentCallback.scheduleTask(startupTask);
|
||||
final Future<?> taskFuture;
|
||||
try {
|
||||
// Trigger the task in a background thread.
|
||||
taskFuture = schedulingAgentCallback.scheduleTask(startupTask);
|
||||
} catch (RejectedExecutionException rejectedExecutionException) {
|
||||
final ValidationState validationState = getValidationState();
|
||||
LOG.error("Unable to start {}. Last known validation state was {} : {}", this, validationState, validationState.getValidationErrors(), rejectedExecutionException);
|
||||
return;
|
||||
}
|
||||
|
||||
// Trigger a task periodically to check if @OnScheduled task completed. Once it has,
|
||||
// this task will call SchedulingAgentCallback#onTaskComplete.
|
||||
|
@ -76,6 +76,7 @@ import java.util.Map.Entry;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
@ -588,7 +589,12 @@ public class StandardControllerServiceNode extends AbstractComponentNode impleme
|
||||
LOG.debug("Cannot enable {} because it is not currently valid. (Validation State is {}: {}). Will try again in 1 second",
|
||||
StandardControllerServiceNode.this, validationState, validationState.getValidationErrors());
|
||||
|
||||
scheduler.schedule(this, 1, TimeUnit.SECONDS);
|
||||
try {
|
||||
scheduler.schedule(this, 1, TimeUnit.SECONDS);
|
||||
} catch (RejectedExecutionException rejectedExecutionException) {
|
||||
LOG.error("Unable to enable {}. Last known validation state was {} : {}", StandardControllerServiceNode.this, validationState, validationState.getValidationErrors(),
|
||||
rejectedExecutionException);
|
||||
}
|
||||
future.complete(null);
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user