You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2023/06/12 13:04:52 UTC

[GitHub] [maven-resolver] gnodet commented on a diff in pull request #299: [MRESOLVER-370] Lock factory diagnostic on failure

gnodet commented on code in PR #299:
URL: https://github.com/apache/maven-resolver/pull/299#discussion_r1226637930


##########
maven-resolver-named-locks/src/main/java/org/eclipse/aether/named/NamedLockFactory.java:
##########
@@ -35,4 +37,18 @@ public interface NamedLockFactory {
      * Performs a clean shut down of the factory.
      */
     void shutdown();
+
+    /**
+     * Utility method to provide more (factory specific) description when a locking operation failed. Assumption is
+     * that provided list has at least one element (one failure) or more (in case of retries), must not be {@code null}
+     * to get meaningful exceptions. The returned exception will be new instance of {@link IllegalStateException} with
+     * passed in list added as suppressed exceptions. Still, the fact this method has be invoked, means there is a
+     * "abort failure" ahead, so factory may either decorate (add info about state) or even log some diagnostic
+     * about the state of the locks.
+     *
+     * @since TBD
+     * @return A new instance of {@link IllegalStateException} (decorated) and may have other side effects as well
+     * (dumping state), never {@code null}.
+     */
+    IllegalStateException failure(List<IllegalStateException> attempts);

Review Comment:
   If `NamedLockFactory` is a public SPI, maybe a `default` method would be more appropriate here ?



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org