Skip to content

Commit

Permalink
Gh-2944: Add CancelScheduledJobHandler only when Jobs are enabled (#3005
Browse files Browse the repository at this point in the history
)

* Previously, the CancelScheduledJobHandler would throw an OperationException with the message 'JobTracker not enabled' if used when Jobs were not enabled. This issue arose because the handler was being added even when Jobs were not enabled. To resolve this, changes were made to ensure that the CancelScheduledJobHandler is only added when Jobs are enabled. This ensures that the handler functions correctly and prevents the unnecessary exception from being thrown.

* Removed the 'CancelScheduledJob.class' from the 'expectedOperations' list. It shouldn't be included when the job tracker is disabled.
  • Loading branch information
Banji0x authored Jul 7, 2023
1 parent 23eb989 commit 9fa78eb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,7 @@ private void addCoreOpHandlers() {
addOperationHandler(GetJobDetails.class, new GetJobDetailsHandler());
addOperationHandler(GetAllJobDetails.class, new GetAllJobDetailsHandler());
addOperationHandler(GetJobResults.class, new GetJobResultsHandler());
addOperationHandler(CancelScheduledJob.class, new CancelScheduledJobHandler());
}

// Output
Expand Down Expand Up @@ -1065,7 +1066,6 @@ private void addCoreOpHandlers() {
addOperationHandler(ToSingletonList.class, new ToSingletonListHandler());
addOperationHandler(Reduce.class, new ReduceHandler());
addOperationHandler(Join.class, new JoinHandler());
addOperationHandler(CancelScheduledJob.class, new CancelScheduledJobHandler());

// Context variables
addOperationHandler(SetVariable.class, new SetVariableHandler());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,6 @@ public void shouldReturnAllSupportedOperationsWhenJobTrackerIsDisabled(@Mock fin
ToSingletonList.class,
ForEach.class,
Reduce.class,
CancelScheduledJob.class,

// Function
Filter.class,
Expand Down

0 comments on commit 9fa78eb

Please sign in to comment.