Lock file maintenance (#7018)