mirror of
https://github.com/kestra-io/kestra.git
synced 2025-12-19 18:05:41 -05:00
fix(core): safeguard for null flow when trying to reset trigger in JdbcExecutor (#13381)
This commit is contained in:
@@ -1135,11 +1135,18 @@ public class JdbcExecutor implements ExecutorInterface {
|
||||
// We need to detect that and reset them as they will never reach the reset code later on this method.
|
||||
if (execution.getTrigger() != null && execution.getState().isFailed() && ListUtils.isEmpty(execution.getTaskRunList())) {
|
||||
FlowWithSource flow = executor.getFlow();
|
||||
triggerRepository
|
||||
.findByExecution(execution)
|
||||
.ifPresent(trigger -> {
|
||||
this.triggerState.update(executionService.resetExecution(flow, execution, trigger));
|
||||
});
|
||||
|
||||
if (flow == null) {
|
||||
log.error("Couldn't reset trigger for execution {} as flow {} is missing. Trigger {} might stay stuck.",
|
||||
execution.getId(),
|
||||
execution.getTenantId() + "/" + execution.getNamespace() + "/" + execution.getFlowId(),
|
||||
execution.getTrigger().getId()
|
||||
);
|
||||
} else {
|
||||
triggerRepository
|
||||
.findByExecution(execution)
|
||||
.ifPresent(trigger -> this.triggerState.update(executionService.resetExecution(flow, execution, trigger)));
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user