Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handler for CancelScheduledJob is added regardless of if Jobs are used #2944

Closed
GCHQDeveloper314 opened this issue May 11, 2023 · 0 comments · Fixed by #3005
Closed

Handler for CancelScheduledJob is added regardless of if Jobs are used #2944

GCHQDeveloper314 opened this issue May 11, 2023 · 0 comments · Fixed by #3005
Labels
bug Confirmed or suspected bug good first issue Small, lower complexity and doesn't require pre-existing Gaffer knowledge
Milestone

Comments

@GCHQDeveloper314
Copy link
Member

Describe the bug
In Store, the CancelScheduledJob operation handler is always added. Whereas all other Job related operation handlers are only added if Jobs are enabled. Unless there's a reason for this, the CancelScheduledJob operation handler should be treated the same as other Job related operation handlers and only be added if Jobs are enabled.

Details

Expected behavior
Handlers not added inconsistently and not added if they cannot be used.

Assumed Fix
In Store.java, move the addOperationHandler call for CancelScheduledJob into the section which runs only when jobs are enabled.

@GCHQDeveloper314 GCHQDeveloper314 added bug Confirmed or suspected bug good first issue Small, lower complexity and doesn't require pre-existing Gaffer knowledge labels May 11, 2023
@GCHQDeveloper314 GCHQDeveloper314 added this to the post-v2.0_backlog milestone May 11, 2023
GCHQDeveloper314 pushed a commit that referenced this issue Jul 7, 2023
)

* 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.
@GCHQDeveloper314 GCHQDeveloper314 modified the milestones: Backlog, v2.1.0 Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed or suspected bug good first issue Small, lower complexity and doesn't require pre-existing Gaffer knowledge
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant