jelmini commented on code in PR #1204: URL: https://github.com/apache/jackrabbit-oak/pull/1204#discussion_r1391411575
########## 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: 5 and 40 seconds were just examples and could be adjusted to, say, 10 and 30. With those values, with my proposal, we block writes after lease renewal fails multiple times (after first renewal failure with a OperationTimeout, retry happens immediately) but at most after 30 seconds. Currently we renew only after 30 seconds, which seems too late to recover from safely, that's why I argue that we should renew more often and have a separate deadline timeout to block writes way before the lease expires. Also see my other comment, where I argue we should block `SegmentWriteQueue` as well, to prevent the scenario you mention of a writer thread still trying to write because it just passed the check before the block. -- 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