26 Commits

Author SHA1 Message Date
Loïc Mathieu
2d2cb00cab feat(execution): bring support for input and output processing in the run context
Part-of: https://github.com/kestra-io/kestra-ee/issues/4228

Encapsulate access the FlowInputOutput from the RunContext in a new InputAndOutput component with a currated list of supported methods used by plugins.
2025-12-16 12:19:48 +01:00
Roman Acevedo
7aca309be5 feat(dashboard): calculate running execution duration on the fly 2025-12-01 16:06:35 +01:00
brian-mulier-p
f06b1c5347 fix(core): concurrency limit on JDBC was decrementing when using FAIL or CANCEL behavior (#13220)
closes https://github.com/kestra-io/kestra/issues/13141
2025-12-01 12:44:30 +01:00
Loïc Mathieu
91330496f2 fix(execution): failed flowable should also have a failed attempt
When a flowable fail, it should also switch its attempts to FAILED.

Fixes #12614
2025-12-01 09:50:38 +01:00
Florian Hussonnois
5a8552ad36 refactor(core): remove LogService
Move static methods to Logs utility class
Move purge method to existing ExecutionLogService
2025-11-28 17:48:23 +01:00
Loïc Mathieu
8f4bafc666 feat(execution): add an attemps on skipped tasks 2025-11-26 18:11:07 +01:00
YannC
68ace7a59b fix: loop until avoid taskrun duplication + handle submitted status (#13023)
* fix: in LoopUntil, missing handle of submitted task in the resolveWaitForNext method

* fix: remove useless code that was generating duplicate taskrun
2025-11-19 15:14:18 +01:00
Loïc Mathieu
1d1a065833 fix(tests): lower termination grace period
If a test mis-behave, for ex starting an execution but not terminating it, as the default termination grace period is 5mn it can take very long time to wait for post-test terminaison.
Switching to a termination grace period of 5s may help.

I also detect that the ExecutionControllerRunner test when launching the test suite, would not properly kill the `sleep-long` flow so waiting for it to complete, or the termination grace period. When a test that use this flow is launched separatly it works properly. As a safety net I reduce the sleep from 5mn to 30s.
2025-11-19 11:58:06 +01:00
Loïc Mathieu
41f83949f0 chore(system): replace Flow by FlowInterface where possible
Part-of: https://github.com/kestra-io/kestra/issues/8274
2025-11-18 09:50:49 +01:00
Loïc Mathieu
9957b1659e fix(flow): flow trigger with both conditions and preconditions
When a flow have both a condition and a precondition, the condition was evaluated twice which lead to double execution triggered.

Fixes
2025-11-14 16:35:15 +01:00
mustafatarek
58fd6c1c48 refactor(core): move flowable attempt state change into termination ensuring task termination 2025-10-22 14:26:13 +02:00
mustafatarek
c6e7ff9436 fix(core): transfer flowable attempt creation from saveFlowableOutput() to TaskRun to fix tests 2025-10-22 14:26:13 +02:00
mustafatarek
6e7d6de2e2 test: try to fix 2025-10-22 14:26:13 +02:00
Loïc Mathieu
01d79f34a4 Update executor/src/main/java/io/kestra/executor/ExecutorService.java 2025-10-22 14:26:13 +02:00
mustafatarek
24e2f5a0f6 feat(core): add unit tests for flowable task attempts( If and Sequential) 2025-10-22 14:26:13 +02:00
mustafatarek
aee3854155 refactor: remove unnecessary comments 2025-10-22 14:26:13 +02:00
mustafatarek
1771955717 feat(core): handle flowable task attempts state transitions 2025-10-22 14:26:13 +02:00
mustafatarek
7c7d606b48 feat(core): add attempts for flowable tasks 2025-10-22 14:26:13 +02:00
Maru Karthik Reddy
832c6eb313 fix(executions): ExecutionUpdatableTask attempt state tracking to record proper duration (#12206)
* fix(executor): record CREATED/RUNNING/SUCCESS states for ExecutionUpdatableTask attempts

Previously, ExecutionUpdatableTask attempts were created with only the
terminal state, skipping RUNNING and causing zero duration and incorrect UI display.

Update attempts through all state transitions:
- CREATED → RUNNING before task.update() call
- RUNNING → terminal state after execution

This preserves complete state history and enables accurate duration tracking.

* refactor: simplify attempt creation in handleExecutionUpdatingTask

Remove null/empty check for attempts list as no attempts exist at this
execution stage. Create attempt directly with RUNNING state using
`new State().withState(State.Type.RUNNING)`.

This simplifies the code while maintaining correct state transitions
(CREATED → RUNNING → terminal).

* test(RuntimeLabels): add state transition assertions
for ExecutionUpdatableTask in Labels tests

Verify that ExecutionUpdatableTask attempts record complete state transitions
(CREATED → RUNNING → SUCCESS) across all Labels test scenarios
2025-10-22 09:49:18 +02:00
Loïc Mathieu
5c24308e71 fix(executions): evaluate multiple conditions in a separate queue
By evaluating multiple condition in a separate queue, we serialize their evaluation which avoir races when we compute the outputs for flow triggers.
This is because evaluation is a multi step process: first you get the existing condtion, then you evaluate, then you store the result. As this is not guarded by a lock you must not do it concurrently.

The race can still occurs if muiltiple executors run but this is less probable. A re-implementation would be needed probably in 2.0 for that.

Fixes https://github.com/kestra-io/kestra-ee/issues/4602
2025-10-03 10:35:49 +02:00
Loïc Mathieu
b43fd14625 feat(system): allow to skip an indexer record
Part-of: https://github.com/kestra-io/kestra-ee/issues/5263
2025-09-29 17:35:43 +02:00
yuri1969
01293de91c fix(core): enable runIf at execution updating tasks 2025-09-25 10:23:13 +02:00
Ludovic DEHON
0d35b5b355 fix(system): make skip flow and namespace resilient to errors 2025-09-19 23:53:17 +02:00
Loïc Mathieu
7d37d2be93 fix(executions): possible NPE on dynamic taskrun
Fixes https://github.com/kestra-io/kestra-ee/issues/5166
2025-09-17 15:55:52 +02:00
Loïc Mathieu
71cdd02230 fix(executions): add logs in case of concurrency limit failure
Fixes #11004
2025-09-04 13:03:00 +02:00
Loïc Mathieu
a5724bcb18 chore(system): extract the executor to its own module 2025-09-04 11:04:13 +02:00