[jira] [Commented] (SLING-6503) Concurrency issue can prevent repository packages to be cleaned up

2017-02-03 Thread Timothee Maret (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-6503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15851601#comment-15851601
 ] 

Timothee Maret commented on SLING-6503:
---

Thanks [~teofili] for looking at this! 

Commit in 
https://svn.apache.org/repos/asf/sling/trunk@1781568

The patch enable a periodical (every 60 seconds by default, configurable) task 
({{o.a.s.d.p.i.ResourceDistributionPackageCleanup}}) to run and delete the 
package which have been released explicitly and which have no more references. 
Only the 
{{org.apache.sling.distribution.packaging.impl.ResourceDistributionPackage}} 
(packages stored in the repository) are collected that way, the behaviour for 
other packages (e.g. stored in files) is not changed.

> Concurrency issue can prevent repository packages to be cleaned up   
> -
>
> Key: SLING-6503
> URL: https://issues.apache.org/jira/browse/SLING-6503
> Project: Sling
>  Issue Type: Bug
>  Components: Content Distribution
>Affects Versions: Content Distribution Core 0.1.18
>Reporter: Timothee Maret
>Assignee: Timothee Maret
> Fix For: Content Distribution Core 0.1.20
>
> Attachments: SLING-6503.patch
>
>
> In SCD setups with more than one export queue and storing packages in the 
> repository, packages may not be collected after being distributed to all 
> queues.
> This is typically the case on the author instance of a Sync setup.
> The current implementation [0] stores a resource in the repository in order 
> to keep track of each consumer of the package. When each consumer is done 
> distributing to its queue, it checks if there is no more registered resources 
> and remove the package if it is the case.
> The problem is that consumers run concurrently and without synchronisation, 
> thus leading to situation where all consumers concurrently observe remaining 
> consumers and the cleanup is never executed.
> [0] 
> https://github.com/apache/sling/blob/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/ResourceDistributionPackage.java



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (SLING-6503) Concurrency issue can prevent repository packages to be cleaned up

2017-02-03 Thread Tommaso Teofili (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-6503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15851579#comment-15851579
 ] 

Tommaso Teofili commented on SLING-6503:


+1 LGTM

> Concurrency issue can prevent repository packages to be cleaned up   
> -
>
> Key: SLING-6503
> URL: https://issues.apache.org/jira/browse/SLING-6503
> Project: Sling
>  Issue Type: Bug
>  Components: Content Distribution
>Affects Versions: Content Distribution Core 0.1.18
>Reporter: Timothee Maret
>Assignee: Timothee Maret
> Fix For: Content Distribution Core 0.1.20
>
> Attachments: SLING-6503.patch
>
>
> In SCD setups with more than one export queue and storing packages in the 
> repository, packages may not be collected after being distributed to all 
> queues.
> This is typically the case on the author instance of a Sync setup.
> The current implementation [0] stores a resource in the repository in order 
> to keep track of each consumer of the package. When each consumer is done 
> distributing to its queue, it checks if there is no more registered resources 
> and remove the package if it is the case.
> The problem is that consumers run concurrently and without synchronisation, 
> thus leading to situation where all consumers concurrently observe remaining 
> consumers and the cleanup is never executed.
> [0] 
> https://github.com/apache/sling/blob/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/ResourceDistributionPackage.java



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (SLING-6503) Concurrency issue can prevent repository packages to be cleaned up

2017-02-03 Thread Timothee Maret (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-6503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15851559#comment-15851559
 ] 

Timothee Maret commented on SLING-6503:
---

Attached a patch otherwise available at 
https://github.com/tmaret/sling/commit/e67a77a0664145d5607ea822f2523a4505f53023.patch

> Concurrency issue can prevent repository packages to be cleaned up   
> -
>
> Key: SLING-6503
> URL: https://issues.apache.org/jira/browse/SLING-6503
> Project: Sling
>  Issue Type: Bug
>  Components: Content Distribution
>Affects Versions: Content Distribution Core 0.1.18
>Reporter: Timothee Maret
>Assignee: Timothee Maret
> Fix For: Content Distribution Core 0.1.20
>
> Attachments: SLING-6503.patch
>
>
> In SCD setups with more than one export queue and storing packages in the 
> repository, packages may not be collected after being distributed to all 
> queues.
> This is typically the case on the author instance of a Sync setup.
> The current implementation [0] stores a resource in the repository in order 
> to keep track of each consumer of the package. When each consumer is done 
> distributing to its queue, it checks if there is no more registered resources 
> and remove the package if it is the case.
> The problem is that consumers run concurrently and without synchronisation, 
> thus leading to situation where all consumers concurrently observe remaining 
> consumers and the cleanup is never executed.
> [0] 
> https://github.com/apache/sling/blob/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/ResourceDistributionPackage.java



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (SLING-6503) Concurrency issue can prevent repository packages to be cleaned up

2017-02-01 Thread Timothee Maret (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-6503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15848565#comment-15848565
 ] 

Timothee Maret commented on SLING-6503:
---

I think this should be fixed by running a periodical job to cleanup the package 
which is robust and simple. 
Indeed, in this case we can afford the delay, synchronising the access is 
overkill.

> Concurrency issue can prevent repository packages to be cleaned up   
> -
>
> Key: SLING-6503
> URL: https://issues.apache.org/jira/browse/SLING-6503
> Project: Sling
>  Issue Type: Bug
>  Components: Content Distribution
>Affects Versions: Content Distribution Core 0.1.18
>Reporter: Timothee Maret
>Assignee: Timothee Maret
> Fix For: Content Distribution Core 0.1.20
>
>
> In SCD setups with more than one export queue and storing packages in the 
> repository, packages may not be collected after being distributed to all 
> queues.
> This is typically the case on the author instance of a Sync setup.
> The current implementation [0] stores a resource in the repository in order 
> to keep track of each consumer of the package. When each consumer is done 
> distributing to its queue, it checks if there is no more registered resources 
> and remove the package if it is the case.
> The problem is that consumers run concurrently and without synchronisation, 
> thus leading to situation where all consumers concurrently observe remaining 
> consumers and the cleanup is never executed.
> [0] 
> https://github.com/apache/sling/blob/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/ResourceDistributionPackage.java



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)