You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2021/06/09 08:26:09 UTC

[GitHub] [sling-org-apache-sling-jcr-repoinit] joerghoh edited a comment on pull request #18: SLING-10418 implement a retry for the application of the statements

joerghoh edited a comment on pull request #18:
URL: https://github.com/apache/sling-org-apache-sling-jcr-repoinit/pull/18#issuecomment-857440053


   It is a transient problem, because mixins are also stored as part of the repo:
   ```
   Caused by: javax.jcr.InvalidItemStateException: Failed to register node types.
   	at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:238) [org.apache.jackrabbit.oak-api:1.39.0.R1889746]
   ...
   Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: OakState0001: Unresolved conflicts in /jcr:system/jcr:nodeTypes/dam:cfVariationNode
   
   ```
   
   and can fail due to concurrency (as indicated by this OakState0001 exception). Same as path creation, user creation, ACL setup etc. Moving the retries into these specific operations doesn't make much sense to me, as it would duplicate a lot of code with no benefit. 
   
   There might be root causes where retry doesn't make sense because the operation will always fail (for example setting an ACL to a non-existing path). Avoiding to retry these is work because you need to review the different types of exceptions to understand if they indicate a transient or permanent failure, and if a retry makes sense. 
   
   Of course we can do that, but I consider the benefit very limited, because it would save ~6 seconds (retries after 1,2 and 3 seconds) until the repoinit operation finally fails. Also situations like this (incorrect repo init statements) should never the normal case, while concurrency issues are more likely to happen. The case mentioned above with perfectly valid rep init statements led to startup failures of a more than dozen cases.


-- 
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.

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