martinweiler commented on code in PR #2333:
URL:
https://github.com/apache/incubator-kie-kogito-apps/pull/2333#discussion_r3483457467
##########
jobs/jobs-common-embedded/src/main/java/org/kie/kogito/app/jobs/impl/VertxJobScheduler.java:
##########
@@ -435,6 +453,84 @@ public JobTimeoutExecution call() throws Exception {
return current;
}
+ /**
+ * Handles retry scheduling for RETRY and ERROR job statuses.
+ * If there's an active transaction that was marked for rollback,
schedules the retry
+ * in a new transaction. Otherwise, persists the job immediately.
+ */
+ private void scheduleRetry(JobContext jobContext, JobDetails jobDetails) {
+ String jobId = jobDetails.getId();
+ JobStatus status = jobDetails.getStatus();
+
+ // Check if we need to execute in a new transaction
+ if (transactionRollbackMarker != null &&
transactionRollbackMarker.isTransactionActive()) {
+ // Current transaction will be rolled back, so schedule retry in a
new transaction
+ LOG.trace("Job {} with status {} will be scheduled in new
transaction", jobId, status);
+
+ vertx.executeBlocking(promise -> {
Review Comment:
Good catch, I don't know how I missed the deprecation warning in my IDE.
--
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]