[BZ 1071330] Minimize the duration of the locks