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

ACS-7587 Implement bulk cancellations #2683

Conversation

damianujma
Copy link
Contributor

@damianujma damianujma commented Jun 6, 2024

This PR is to add the cancellation feature for the bulk operation.
POST /holds/{holdId}/bulk-statuses/{bulkStatusId}/cancel - endpoint to cancel the bulk operation

Additionally:

  • Added the bulk operation to the bulk status object in the REST response
  • Added permission check for the bulk cancellation. In order to cancel a user must have the same permissions as for the execution of the cancelled bulk operation.
  • Added FixedThreadPool to the Bulk Service to limit the number of bulk requests we can process in parallel. By default the maximum number of parallel bulk requests is 10. That value is configurable by rm.hold.bulk.maxParallelRequests property.
  • Added tidying bulk statuses after a configurable period of time (by default 30 days).

damianujma and others added 30 commits April 29, 2024 16:00
…_implement_v1_bulk_api_to_add_items

# Conflicts:
#	amps/ags/rm-community/rm-community-rest-api-explorer/src/main/webapp/definitions/gs-core-api.yaml
…re/ACS-7587_implement_bulk_cancellation

# Conflicts:
#	amps/ags/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/hold/HoldBulkStatus.java
#	amps/ags/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/requests/gscore/api/HoldsAPI.java
#	amps/ags/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/hold/AddToHoldsBulkV1Tests.java
#	amps/ags/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/alfresco-global.properties
#	amps/ags/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/rm-bulk-context.xml
#	amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/bulk/BulkBaseService.java
#	amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/bulk/BulkMonitor.java
#	amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/bulk/hold/DefaultHoldBulkMonitor.java
#	amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/bulk/hold/HoldBulkMonitor.java
#	amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/bulk/hold/HoldBulkProcessDetails.java
#	amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/bulk/hold/HoldBulkService.java
#	amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/bulk/hold/HoldBulkServiceImpl.java
#	amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/bulk/hold/HoldBulkStatusUpdater.java
#	amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/holds/HoldsBulkStatusesRelation.java
#	amps/ags/rm-community/rm-community-repo/source/java/org/alfresco/rm/rest/api/holds/HoldsEntityResource.java
#	amps/ags/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/bulk/DefaultHoldBulkMonitorUnitTest.java
Copy link
Member

@tpage-alfresco tpage-alfresco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When do the bulk jobs get tidied up? Is it possible that the list will increase indefinitely and the API to list them will require a lot of paging?

@damianujma
Copy link
Contributor Author

damianujma commented Jun 11, 2024

When do the bulk jobs get tidied up? Is it possible that the list will increase indefinitely and the API to list them will require a lot of paging?

@tpage-alfresco The bulk jobs get tidied up when an instance or all instances in a clustered environment are restarted because they are stored in the cache. I think tidying up is a good approach but I'm not sure what TTL cache configuration would be appropriate.

@damianujma damianujma requested a review from dsibilio June 13, 2024 11:40
Copy link
Contributor

@aonych aonych left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@tpage-alfresco tpage-alfresco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@damianujma damianujma merged commit cfda13d into feature/ACS-7556_bulk_update_in_legal_holds Jun 17, 2024
87 checks passed
@damianujma damianujma deleted the feature/ACS-7587_implement_bulk_cancellation branch June 17, 2024 10:32
damianujma added a commit that referenced this pull request Jun 19, 2024
* ACS-7557 Add Legal Holds Bulk v1 API (#2624)

* ACS-7557 Add Legal Holds Bulk v1 API

* ACS-7557 Improve v1 API

* ACS-7557 Replace processId with bulkStatusId

* ACS-7587 Implement v1 Bulk API to add items to a hold (#2656)

* ACS-7557 Add bulk API design

* ACS-7557 Fix 

* ACS-7557 Add permissions checks 

* ACS-7557 Add IT tests

* ACS-7557 Add comments + logging

* ACS-7557 Refactor

* ACS-7557 Reimplement task container

* ACS-7557 Refactor code

* ACS-7587 Remove merge leftovers

* ACS-7587 Refactor 

* ACS-7587 Tests 

* ACS-7587 Change DefaultHoldBulkMonitor

* ACS-7587 Reimplement BulkStatusUpdater

* ACS-7587 Fix PMD issues

* ACS-7587 Fix PMD isues

* ACS-7587 Refactor

* ACS-7587 Add test files alternately

* ACS-7587 Refactor code

* ACS-7587 Improve search query

* ACS-7587 Fix PMD issues

* ACS-7587 Fix PMD issue

* ACS-7587 Fix intermittent failure

* ACS7587 Fix intermittent failure (#2681)

* ACS-7587 Implement bulk cancellations (#2683)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants