Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
Separation of concerns dictate that there's a loose coupling between Distribution Packages and Queue entries, and thus the distribution-packages and queue-items are persisted in different sessions (indeed, depending on queue-impl/distribution-packaging-impl chosen there may not be a need to persist either, or any of them at all).
To enable collection of unreferenced Distribution packages, currently, queue items are be acquired [0] and released [1] on a per-queue basis in MultipleQueueDispatchingStrategy. Only the distribution-packages that don't have any live references are claimed.
For a 1:1 distribution (as SingleQueueDispatchingStrategy [2] aims to achieve), acquring and releasing packages is superfluous (since there's only one queue) and as such it should just be sufficient to mark the package 'released' [3] once the queue is done with it.
However, the ref-updates still happen given way it is implemented currently (as a subclass of MultipleQueueDispatchingStrategy that doesn't override anything [2]).
Opening this issue propose improving SingleQueueDispatchingStrategy impl. This should slightly optimize the book-keeping and marginally reduce the write-overhead for 1:1 distribution.
[0] https://github.com/apache/sling-org-apache-sling-distribution-core/blob/537bb57af821f21537cf4a24ad7d2347c6a5dae1/src/main/java/org/apache/sling/distribution/queue/impl/MultipleQueueDispatchingStrategy.java#L61
[1] https://github.com/apache/sling-org-apache-sling-distribution-core/blob/537bb57af821f21537cf4a24ad7d2347c6a5dae1/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentQueueProcessor.java#L169
[2] https://github.com/apache/sling-org-apache-sling-distribution-core/blob/537bb57af821f21537cf4a24ad7d2347c6a5dae1/src/main/java/org/apache/sling/distribution/queue/impl/SingleQueueDispatchingStrategy.java
[3] https://github.com/apache/sling-org-apache-sling-distribution-core/blob/537bb57af821f21537cf4a24ad7d2347c6a5dae1/src/main/java/org/apache/sling/distribution/packaging/impl/DistributionPackageUtils.java#L107-L111
Attachments
Issue Links
- links to