Previous Topic: hrefresh Argument File DefinitionNext Topic: Encrypted Password Files


Semaphore Locks

CA Harvest SCM uses semaphore locks to help prevent failures that may occur when multiple check-out operations for the same target directory are run concurrently. For example, a configuration post‑links hrefresh to the check‑in process. Each time a user checks in versions, hrefresh automatically synchronizes one or more corresponding reference directories. When another check‑in occurs in the same state before the first hrefresh job is finished, a semaphore file created by the first job blocks the second hrefresh job. The second job waits for a specified period (set by the ‑retrydelay=n parameter) for the first job to finish. The second job aborts if the semaphore file is not released within the specified period.

The semaphore-lock files that hrefresh creates are named project_state_host.lock and are stored in the directory that you specify as your hrefresh home directory. These lock files are not deleted when jobs complete. An active job obtains an exclusive lock on the semaphore file when it starts, and releases that lock when it finishes.

In some cases, you may want to change this locking behavior; for example, when you want to synchronize multiple separate directories on a single host. The hrefresh configuration file may contain the following entries:

#Project ,  State ,, Viewpath   , Clientpath, Type, Host , ...
Project 1, State 1,, \Rep1\path1, /dir1     , Full, host1, ...
Project 1, State 1,, \Rep1\path2, /dir2     , Full, host1, ...
Project 1, State 1,, \Rep1\path3, /dir3     , Full, host1, ...

In this example, by default, hrefresh does not allow the check-outs for these three directories to execute concurrently. Instead, the processes run consecutively. The job for /dir1 starts, and the other jobs wait until that job is finished.

For some users, the semaphore locks that require processes to run consecutively are more time-consuming than necessary. To override semaphore locks and allow the jobs to run concurrently, specify the ‑nolock option, as follows:

Note: For details about hrefresh command-line options, see the Command Line Reference Guide.