jsedding commented on code in PR #51: URL: https://github.com/apache/sling-org-apache-sling-jcr-repoinit/pull/51#discussion_r1520623262
########## src/main/java/org/apache/sling/jcr/repoinit/impl/RepositoryInitializerFactory.java: ########## @@ -78,14 +79,22 @@ public class RepositoryInitializerFactory implements SlingRepositoryInitializer private final Logger log = LoggerFactory.getLogger(getClass()); + private static final String METRIC_REPOINIT_FAILED = RepositoryInitializerFactory.class.getName() + ".failed"; @Reference private RepoInitParser parser; @Reference private JcrRepoInitOpsProcessor processor; + + @Reference + MetricsService metrics; private RepositoryInitializerFactory.Config config; + + // assume that repoinit succeeds ... and just this to true if it fails + private boolean aRepoInitStatementFailed = false; Review Comment: I think this field should be `volatile` (or another mechanism to ensure visibility should be used). IMHO there is a high probability that the metric is written and read from different threads. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@sling.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org