martinweiler commented on code in PR #2301:
URL:
https://github.com/apache/incubator-kie-kogito-apps/pull/2301#discussion_r2789642961
##########
jobs/jobs-common-embedded/src/main/java/org/kie/kogito/app/jobs/impl/VertxJobScheduler.java:
##########
@@ -407,6 +417,14 @@ public JobTimeoutExecution call() throws Exception {
} catch (Exception exception) {
LOG.trace("Timeout {} with jobId {} will be retried if
possible", timerId, jobId, exception);
JobDetails nextJobDetails = computeRetryIfAny(jobDetails);
+
+ // Extract and set exception details AFTER
computeRetryIfAny but BEFORE persistence
+ // Note: computeRetryIfAny creates a new JobDetails
object, so we must set exception details after it
+ JobExecutionExceptionDetails exceptionDetails =
extractExceptionDetails(exception);
+ if (exceptionDetails != null) {
+ nextJobDetails.setExceptionDetails(exceptionDetails);
Review Comment:
I am not sure the logic to set the exception on the *next* job is correct. I
am testing with a process that has a service task looking like this, and the
node is marked as async:
```
if(executionCount.get(processInstanceId) < 3) {
throw new RuntimeException("EXCEPTION NUMBER " +
executionCount.get(processInstanceId));
}
```
Looking at the `job_execution_log` table, I see the following log entries :
```
SELECT id, job_id, retries, status, exception_details FROM
public.job_execution_log
152 "d69f5689-436c-4009-8342-85516b792c4b" 0 "RUNNING"
153 "d69f5689-436c-4009-8342-85516b792c4b" 1 "RETRY" "Process
instance with id bcc0c12e-6082-4dce-ad74-a0ab96c6e575 failed because of
[HelloWorld:bcc0c12e-6082-4dce-ad74-a0ab96c6e575 - Dummy Service
Task:[uuid=_5E115E1B-9B42-40CB-A924-3F75A568B0F0]] -- EXCEPTION NUMBER 1"
154 "d69f5689-436c-4009-8342-85516b792c4b" 1 "RETRY" "Process
instance with id bcc0c12e-6082-4dce-ad74-a0ab96c6e575 failed because of
[HelloWorld:bcc0c12e-6082-4dce-ad74-a0ab96c6e575 - Dummy Service
Task:[uuid=_5E115E1B-9B42-40CB-A924-3F75A568B0F0]] -- EXCEPTION NUMBER 1"
155 "d69f5689-436c-4009-8342-85516b792c4b" 1 "RUNNING"
"Process instance with id bcc0c12e-6082-4dce-ad74-a0ab96c6e575 failed because
of [HelloWorld:bcc0c12e-6082-4dce-ad74-a0ab96c6e575 - Dummy Service
Task:[uuid=_5E115E1B-9B42-40CB-A924-3F75A568B0F0]] -- EXCEPTION NUMBER 1"
156 "d69f5689-436c-4009-8342-85516b792c4b" 2 "RETRY" "Process
instance with id bcc0c12e-6082-4dce-ad74-a0ab96c6e575 failed because of
[HelloWorld:bcc0c12e-6082-4dce-ad74-a0ab96c6e575 - Dummy Service
Task:[uuid=_5E115E1B-9B42-40CB-A924-3F75A568B0F0]] -- EXCEPTION NUMBER 2"
157 "d69f5689-436c-4009-8342-85516b792c4b" 2 "RETRY" "Process
instance with id bcc0c12e-6082-4dce-ad74-a0ab96c6e575 failed because of
[HelloWorld:bcc0c12e-6082-4dce-ad74-a0ab96c6e575 - Dummy Service
Task:[uuid=_5E115E1B-9B42-40CB-A924-3F75A568B0F0]] -- EXCEPTION NUMBER 2"
158 "d69f5689-436c-4009-8342-85516b792c4b" 2 "RUNNING"
"Process instance with id bcc0c12e-6082-4dce-ad74-a0ab96c6e575 failed because
of [HelloWorld:bcc0c12e-6082-4dce-ad74-a0ab96c6e575 - Dummy Service
Task:[uuid=_5E115E1B-9B42-40CB-A924-3F75A568B0F0]] -- EXCEPTION NUMBER 2"
159 "d69f5689-436c-4009-8342-85516b792c4b" 2 "EXECUTED"
"Process instance with id bcc0c12e-6082-4dce-ad74-a0ab96c6e575 failed because
of [HelloWorld:bcc0c12e-6082-4dce-ad74-a0ab96c6e575 - Dummy Service
Task:[uuid=_5E115E1B-9B42-40CB-A924-3F75A568B0F0]] -- EXCEPTION NUMBER 2"
```
Shouldn't lines 152, 155, 158 show the result of the current job execution,
which means the first RUNNING entry would have to show EXCEPTION NUMBER 1 and
so on?
In line 159 I think having an exception still recorded is not correct.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]