smiroslav commented on code in PR #1204:
URL: https://github.com/apache/jackrabbit-oak/pull/1204#discussion_r1391370252


##########
oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureRepositoryLock.java:
##########
@@ -100,7 +105,11 @@ private void refreshLease() {
             try {
                 long timeSinceLastUpdate = (System.currentTimeMillis() - 
lastUpdate) / 1000;
                 if (timeSinceLastUpdate > INTERVAL / 2) {
+                    writeAccessController.disableWriting();

Review Comment:
   > Even a successful call to blob.acquireLease() could take a long time if 
Azure is slow.
   
   It is possible to do that optimization, but if Azure, as you said, is slow, 
then threads in SegmentWriteQueue will be slow to write to the remote repo as 
well. 
   
   If we block writes only 40 seconds after issuing blob.renewLease, the lease 
at that time will be 5 + 40 seconds old. 
   
   The writer thread might pass 
```WriteAccessController#checkWritingAllowed```condition at 44 seconds after 
lease renewal and then struggle for the next 20 seconds to write the segment. 
   



-- 
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...@jackrabbit.apache.org

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

Reply via email to