cschneider opened a new pull request, #79: URL: https://github.com/apache/sling-org-apache-sling-distribution-core/pull/79
https://issues.apache.org/jira/browse/SLING-13356 `ResourceDistributionPackageCleanup` deletes every disposable package in a single JCR commit (`delete(false)` inside the loop, one `commit()` after the loop). On a resource-persisted distribution agent with a large package backlog this becomes a single unbounded transaction — we saw a real case with ~1.5-1.75 million disposable packages (~7 million node deletions in one commit) that never completed and put the underlying repository under sustained load. This PR commits in bounded batches inside the loop instead of committing once at the end: - New `cleanupBatchSize` constructor parameter on `ResourceDistributionPackageCleanup`, plus a matching OSGi config attribute (default 100) on both `DistributionPackageBuilderFactory` and `VaultDistributionPackageBuilderFactory`. - A value `<= 0` preserves the previous single-commit-per-run behavior. - The existing two-argument constructor is kept for backward compatibility (defaults to batching disabled), in case anything outside this repo constructs `ResourceDistributionPackageCleanup` directly. - Added `ResourceDistributionPackageCleanupTest` covering: batching across a remainder-sized backlog, an exact-multiple-of-batch-size backlog (no wasted trailing commit), non-disposable packages being left alone, and the `<= 0`/deprecated-constructor fallback to single-commit behavior. Related: SLING-10743 (same class, similar package path in its own example, but a different root cause — concurrent-instance arbitration, already fixed). -- 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]
