<div dir="ltr">I'm not sure about the topology cache, but I don't think this would be useful for the cluster registry.<div><br><div>The cluster registry is a global component, so it's only stopped *after* all the caches, and other components are not supposed to know that the cluster registry implementation uses a cache.</div>
<div><br></div><div>Cheers</div><div>Dan<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 19, 2014 at 5:02 PM, Tristan Tarrant <span dir="ltr"><<a href="mailto:ttarrant@redhat.com" target="_blank">ttarrant@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks, this actually has multiple issues currently:<br>
<br>
- the default cache is stopped last (why ?)<br>
- some "service" caches need to be handled manually: e.g. the registry<br>
and the topology cache.<br>
<br>
A generic ref counting system would be a great improvement<br>
<span class="HOEnZb"><font color="#888888"><br>
Tristan<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On 15/08/14 14:29, Sanne Grinovero wrote:<br>
> The goal being to resolve ISPN-4561, I was thinking to expose a very<br>
> simple reference counter in the AdvancedCache API.<br>
><br>
> As you know the Query module - which triggers on indexed caches - can<br>
> use the Infinispan Lucene Directory to store its indexes in a<br>
> (different) Cache.<br>
> When the CacheManager is stopped, if the index storage caches are<br>
> stopped first, then the indexed cache is stopped, this might need to<br>
> flush/close some pending state on the index and this results in an<br>
> illegal operation as the storate is shut down already.<br>
><br>
> We could either implement a complex dependency graph, or add a method like:<br>
><br>
><br>
> boolean incRef();<br>
><br>
> on AdvancedCache.<br>
><br>
> when the Cache#close() method is invoked, this will do an internal<br>
> decrement, and only when hitting zero it will really close the cache.<br>
><br>
> A CacheManager shutdown will loop through all caches, and invoke<br>
> close() on all of them; the close() method should return something so<br>
> that the CacheManager shutdown loop understand if it really did close<br>
> all caches or if not, in which case it will loop again through all<br>
> caches, and loops until all cache instances are really closed.<br>
> The return type of "close()" doesn't necessarily need to be exposed on<br>
> public API, it could be an internal only variant.<br>
><br>
> Could we do this?<br>
><br>
> --Sanne<br>
> _______________________________________________<br>
> infinispan-dev mailing list<br>
> <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
><br>
<br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</div></div></blockquote></div><br></div></div></div></div>