In https://issues.apache.org/jira/browse/SLING-4372 a mechanism was invented which automatically closes all those resource resolvers which are no longer referenced. That may lead to hard to detect issues in case someone still uses a reference towards the underlying session (in case you deal with a ResourceResolver acting on a JCR) or another object which was adapted from that resource resolver. Would it be possible to somehow detect open references to the underlying sessions or any other objects being adapted from the resource resolver and issue a big WARN or ERROR in that case? I know that this is a programming mistake but not that easy to spot in some cases. Therefore additional logging in case such a situation is detected would be very much appreciated. That would probably mean that we collect all references being issued through the adaptTo method as well. WDYT? Is it worth the overhead?
Konrad