Ensure StepExecutor only logs a stack trace and error if the retries have been exhausted. Otherwise, just log a debug. (#4961)

* Ensure StepExecutor only logs a stack trace and error if the retries have been exhausted.  Otherwise, just log a debug.

* Accept code reviewer suggestion to amend log message

Co-authored-by: michaelabuckley <michaelabuckley@gmail.com>

---------

Co-authored-by: michaelabuckley <michaelabuckley@gmail.com>
This commit is contained in:
Luke deGruchy 2023-06-07 09:05:08 -04:00 committed by GitHub
parent 0a7f97adb7
commit e37edfcf84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -0,0 +1,6 @@
---
type: fix
issue: 4960
jira: SMILE-5740
title: "Running a $delete-expunge MSSQL or Oracle with over 10,000 resources results in a error and a stack trace, even though the job ends in status COMPLETE.
This has been fixed."

View File

@ -70,10 +70,11 @@ public class StepExecutor {
return false; return false;
} catch (Exception e) { } catch (Exception e) {
if (theStepExecutionDetails.hasAssociatedWorkChunk()) { if (theStepExecutionDetails.hasAssociatedWorkChunk()) {
ourLog.error("Failure executing job {} step {}, marking chunk {} as ERRORED", jobDefinitionId, targetStepId, chunkId, e); ourLog.info("Temporary problem executing job {} step {}, marking chunk {} as retriable ERRORED", jobDefinitionId, targetStepId, chunkId);
WorkChunkErrorEvent parameters = new WorkChunkErrorEvent(chunkId, e.getMessage()); WorkChunkErrorEvent parameters = new WorkChunkErrorEvent(chunkId, e.getMessage());
WorkChunkStatusEnum newStatus = myJobPersistence.onWorkChunkError(parameters); WorkChunkStatusEnum newStatus = myJobPersistence.onWorkChunkError(parameters);
if (newStatus == WorkChunkStatusEnum.FAILED) { if (newStatus == WorkChunkStatusEnum.FAILED) {
ourLog.error("Exhausted retries: Failure executing job {} step {}, marking chunk {} as ERRORED", jobDefinitionId, targetStepId, chunkId, e);
return false; return false;
} }
} else { } else {