You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by jo...@apache.org on 2024/07/05 18:10:24 UTC
(sling-org-apache-sling-resourceresolver) branch SLING-12371 created (now fbce6f6)
This is an automated email from the ASF dual-hosted git repository.
joerghoh pushed a change to branch SLING-12371
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git
at fbce6f6 SLING-12371 always update the metric of unclosed RRs
This branch includes the following new commits:
new fbce6f6 SLING-12371 always update the metric of unclosed RRs
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(sling-org-apache-sling-resourceresolver) 01/01: SLING-12371 always update the metric of unclosed RRs
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joerghoh pushed a commit to branch SLING-12371
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git
commit fbce6f6f808a2989e1add9e360187c1f2dff4f26
Author: Joerg Hoh <jo...@apache.org>
AuthorDate: Fri Jul 5 20:08:04 2024 +0200
SLING-12371 always update the metric of unclosed RRs
---
.../impl/CommonResourceResolverFactoryImpl.java | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/main/java/org/apache/sling/resourceresolver/impl/CommonResourceResolverFactoryImpl.java b/src/main/java/org/apache/sling/resourceresolver/impl/CommonResourceResolverFactoryImpl.java
index d04942f..57aa6c8 100644
--- a/src/main/java/org/apache/sling/resourceresolver/impl/CommonResourceResolverFactoryImpl.java
+++ b/src/main/java/org/apache/sling/resourceresolver/impl/CommonResourceResolverFactoryImpl.java
@@ -528,16 +528,18 @@ public class CommonResourceResolverFactoryImpl implements MapConfigurationProvid
public void close(Optional<ResourceResolverMetrics> metrics) {
try {
- if (factory.unregisterControl(this.control) && factory.logUnclosedResolvers) {
- if (factory.isLive()) {
- LOG.warn("Closed unclosed ResourceResolver. The creation stacktrace is available on info log level.");
- if (metrics.isPresent()) {
- metrics.get().reportUnclosedResourceResolver();
+ if (factory.unregisterControl(this.control)) {
+ if (metrics.isPresent()) {
+ metrics.get().reportUnclosedResourceResolver();
+ }
+ if (factory.logUnclosedResolvers) {
+ if (factory.isLive()) {
+ LOG.warn("Closed unclosed ResourceResolver. The creation stacktrace is available on info log level.");
+ } else {
+ LOG.warn("Forced close of ResourceResolver because the ResourceResolverFactory is shutting down.");
}
- } else {
- LOG.warn("Forced close of ResourceResolver because the ResourceResolverFactory is shutting down.");
+ LOG.info("Unclosed ResourceResolver was created here: ", openingException);
}
- LOG.info("Unclosed ResourceResolver was created here: ", openingException);
}
} catch (Throwable t) {
LOG.warn("Exception while closing ResolverReference", t);