Repository navigation
mod_dav: Use one clock for lock timeouts - #1107
Merged
arturobernalg merged 1 commit intoNov 27, 2026
Merged
Conversation
f33eb04 (apache#920) took "now" for the lock expiry in dav_get_timeout_string() from apr_time_now(), while the expiry check and the remaining time in the LOCK response still use time(NULL). On Linux time(NULL) can lag gettimeofday() by up to a clock tick, so a LOCK handled right after a second boundary got an expiry one second later than asked: a "Second-0" lock reported "Second-1" or was still held (423). Go back to time(NULL), as on 2.4.x, keeping the overflow capping. Let test_dav_004_01/02 accept one second less, since a second may tick between the LOCK and its response, and add a test locking repeatedly across second boundaries.
5 tasks done
notroj
approved these changes
Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#920 took "now" for the lock expiry from apr_time_now(), while the expiry check and the LOCK response's remaining time still use time(NULL). On Linux time(NULL) can lag gettimeofday() by up to a clock tick, so a LOCK right after a second boundary got one extra second: a "Second-0" lock reported "Second-1" or was still held (423).
This goes back to time(NULL), as on 2.4.x, keeping the overflow capping. test_dav_004_01/02 now accept one second less, and test_dav_004_04 locks repeatedly across second boundaries (fails without the fix, passes with it).
Seen by @ylavic in CI on #1105. cc @notroj
Follow-up to #920 (BZ 65788), trunk only; no CHANGES entry needed.