Merge "Avoid acquiring lock when feature flag is disabled" into main