Product Documentation
Cadence Application Infrastructure User Guide
Product Version IC23.1, November 2023

10


Cadence Locking System

The Cadence® locking system (CLS) is the mechanism used by many Cadence applications to lock files.

CLS creates a lock file, called Lock-Stake file, when it locks a file for editing. The Lock-Stake file contains information about the application that has locked the file.

CLS allows applications to steal locks from active processes; however, few applications support this feature. CLS automatically recovers locks that are stranded if an application exits without releasing the locks.

In addition, CLS provides a user interface for administrative tasks such as releasing all locks in a directory hierarchy.

Applications on OpenAccess

Cadence applications on the OpenAccess 2.2 database use OpenAccess locking instead of CLS. OpenAccess locking is compatible with CLS—the lock file has the same format and file name extension as the file created by CLS, and the same rules are followed while getting locks.

Virtuoso applications on OpenAccess use both CLS and OpenAccess locking; they use OpenAccess locking to lock database files and CLS to lock other files such as CDS.log. Since the two systems are compatible and they lock different files, conflicts should not arise.

OpenAccess locking uses a different daemon, oaFSLockD, instead of the CLS boolean daemon clsbd to recover locks. oaFSLockD is run automatically whenever a library is opened. Virtuoso applications on OpenAccess start both daemons.

You can use the clsAdminTool to search for and release locks created by either system.

A lock set by a host that runs only non-OpenAccess applications (which start only clsbd) cannot be recovered by a native OpenAccess application and vice versa. This is because each locking system needs to talk to its own boolean daemon to recover locks. In such a case, remove stranded locks manually or with clsAdminTool.

Installation

CLS is automatically installed when you install Cadence applications; you do not need to install it separately.

However, on Windows NT, you should manually set up the Boolean daemon (a component of CLS) as a service after you install Cadence applications.

You can also customize how the Boolean daemon is started. The daemon must run on every system that runs Cadence applications. You can set up your system to run the Boolean daemon every time the system is started. This procedure is optional, applications that use CLS start the Boolean daemon if it is not already running on the system.

Related Topics

Setting Up the Boolean Daemon on Windows NT

Adding the Boolean Daemon to System Startup Files

Boolean Daemon (clsbd)

The Boolean daemon, called clsbd, is a daemon that runs on all systems on which any Cadence application using Cadence® locking system (CLS) is running. The daemon responds to requests from remote systems to determine the status of processes that own Edit locks.

There is a default timeout of 20 seconds in respect of clsbd connections. This is also the same time period used for Open Access connections.

When an application wants to lock a file and finds that it is already locked by a process on another system, CLS queries the Boolean daemon running on that system about the status of the process that locked the file. Whether the application can obtain the lock depends on the information CLS receives from the Boolean daemon.

If you do not want CLS to query Boolean daemons on remote hosts (you may not want to query remote hosts if you have firewall access issues, for example), set the following environment variable:

CLS_DONT_QUERY_REMOTE_HOSTS [listOfRemoteHosts]

where listOfRemoteHosts is an optional list of patterns (typically host or domain names), separated by blank spaces, that you do not want CLS to query. For example, if you specify

setenv CLS_DONT_QUERY_REMOTE_HOSTS cds00 cadence.com ns.com

CLS will not query hosts that match cds00 or any hosts from the domains cadence.com or ns.com.

If you do not specify listOfRemoteHosts, CLS will not query any remote hosts.

When the CLS_DONT_QUERY_REMOTE_HOSTS environment variable is set, if CLS comes across a file locked by a remote host, it always assumes that the process that locked the file is still active. Therefore, CLS cannot get a new lock on the file. In such a case, if you want to lock the file, you need to remove the old lock with the CLS administrative tool.

When an application wants to lock a file that is locked by a process on its own host, CLS determines the status of the process directly without sending a query to a Boolean daemon.

Setting Up the Boolean Daemon on Windows NT

After you install Cadence applications on Windows NT, you should manually set up the Boolean daemon as a service so that Cadence applications can start it.

You must have administrator privileges for the following procedure.

To list the Boolean daemon as a service,

  1. Log on to the Windows NT system as a user with administrator privileges.
  2. From the Start menu, choose ProgramsCommand Prompt.
    The MS DOS Command Prompt window appears.
  3. In the MS DOS Command Prompt window, type
    clsbd.exe -install
    The following message appears:
    CDS Boolean Daemon Installed.
  4. Close the MS DOS Command Prompt window by typing exit.
  5. From the Start menu, choose SettingsControl Panel.
  6. In the Control Panel window, double-click Services.
    The Services dialog box appears.
  7. Confirm that CDS Boolean Daemon is listed as a service.
  8. In the Services dialog box, click Close.

Location of the Boolean Daemon

The Boolean daemon is automatically installed when you install Cadence applications.

The Boolean daemon program, clsbd, is located in the following directory:

application_install_dir/tools/bin/

where application_install_dir is the directory in which your Cadence application is installed.

Related Topics

CLS Administrative Tool

Starting the Boolean Daemon

The Boolean daemon must run on all systems that run Cadence applications. It is started in several ways.

Adding the Boolean Daemon to System Startup Files

To add the Boolean daemon to a system startup files, do one of the following:

Starting the CLS Boolean Daemon from the Installation Directory

To start the CLS Boolean daemon from the application installation directory,

You can use the following command-line options when you start clsbd:

-fg

Runs clsbd in the foreground, instead of in the background.

-debug

Turns on clsbd debug messages that are written to the log file.

-logfile fileName

Writes debug messages to the file you specify. The default log file is /tmp/clsbd.userId.processID.

-portnum portNumber

Specifies the port number on which to run clsbd. By default, clsbd uses port 16723 on every system on which it runs. You can use this option if another application is using port 16723 or if a clsbd is already running on that port and you want to run another clsbd.

If the CLS_PORTNUM environment variable is set, clsbd will use the port number that the variable is set to, regardless of whether you specify the -portnum option.

-setuid login

Changes the user ID of the clsbd process to the login you specify, after clsbd is started. You may need to start clsbd with super-user privileges so that it can change the user ID. This option uses the UNIX setuid command.

You can also use this option with the -portnum option to run a non-root clsbd process on a privileged port.

The -setuid option is not available on Windows NT.

-install

Installs the Boolean daemon as a service on Windows NT. This option is only available on Windows NT.

-remove

Removes the Boolean daemon as a service from Windows NT. This option is only available on Windows NT.

-version

Displays the version number of the Boolean daemon.

Related Topics

Setting Up the Boolean Daemon on Windows NT

Changing the CLS Boolean Daemon Port Number

Changing the CLS Boolean Daemon Port Number

If the default port number used by the Boolean daemon is consistently used by another application, you might have to change the Boolean daemon port number. This situation is uncommon.

clsbd uses port number 16723 on every system on which it runs. When clsbd is started, if it finds that this port number is already being used, it checks if another clsbd is running on the system. If another clsbd is running, the new clsbd exits. If another clsbd is not running, the new clsbd exits and displays the following error:

“Fatal (clsbd): port number xxx is in use by a program that is not clsbd. Exiting.”

If you get this error, close and restart the Cadence application. However, if you get this error repeatedly, you have to set a different port number for the Boolean daemon or for the application that is using the Boolean daemon port number.

Because the Boolean daemon is run on all systems that run Cadence applications, if you change the Boolean daemon’s port number you must change it on every system, regardless of the platform.

To change the Boolean daemon port number,

  1. Exit all Cadence applications.
  2. Stop all clsbd processes on all systems.
  3. Set the following environment variable on every system that runs Cadence applications:
    CLS_PORTNUM portNumber
    where portNumber is a port that is not being used.
  4. Restart Cadence applications.
The value of CLS_PORTNUM must be the same on every system that runs Cadence applications on any platform.

Related Topics

Troubleshoot Cadence Locking System Problems

Edit Locks

Cadence® locking system (CLS) locks files with Edit locks. An Edit lock on a file signifies that a process is editing the file and prevents other processes from getting an Edit lock simultaneously on the file. However, a process can steal an Edit lock from another process.

Files remain locked even if the network, or the client or server computer, fails. If the process that holds the lock exits without releasing the lock, the lock is considered stranded. for information about how CLS handles stranded locks, see Recover Stranded Locks.

A file can be locked only if its parent directory has write permissions.

Lock-Stake File

Edit locks are implemented using Lock-Stake files. The existence of a corresponding Lock-Stake file in the same directory as a file indicates that the file is locked.

When an application gets an Edit lock on a file, CLS creates the following Lock-Stake file in the same directory as the file:

filename.cdslck

where filename is the name of the file that is locked.

The Lock-Stake file, an ASCII file, contains information about the lock and the process that holds the lock. The Lock-Stake file has the following information:

The following is a sample .cdslck file:

A file cannot have more than one Edit lock, so it can have only one corresponding Lock-Stake file.

The Lock-Stake file is automatically deleted by the process that owns it when it releases the Edit lock on the file. You can also delete the Lock-Stake file using the CLS administrative interface.

Steal Edit Locks

Applications can steal Edit locks from another process. When a lock is stolen, information about the new owner is added to the Lock-Stake file (filename.cdslock). Information about previous owners is retained at the end of the file.

A few Cadence applications provide this option of stealing locks. See your application’s documentation for information.

Applications cannot steal locks in compatibility mode.

Related Topics

CLS Administrative Tool

Lock Links

In this topic, we are discussing locking the symbolic and hard links.

Setting Your Environment to Lock Hard Links

To force CLS to lock hard links,

Related Topics

Edit Locks

Recover Stranded Locks

Recover Stranded Locks

Stranded locks are locks that remain after the process that owns them has exited. Locks can be stranded if the application or application host exits abnormally, or if the file server is inaccessible.

Stranded Edit locks are recovered in the following ways:

Related Topics

CLS Administrative Tool

Edit Locks

CLS Administrative Tool

The Cadence® locking system (CLS) administrative tool lets you view and release locks in any directory hierarchy.

The clsAdminTool does not differentiate between stranded locks and non-stranded locks.

With the CLS administrative tool, you can:

You can use the adminstrative tool interactively (as a shell interface) or in batch mode.

You need to manually clean up lock stakes as the clsAdminTool automatically recovers any stranded locks. You can however use the clsAdminTool to clean up lock stakes from those libraries that have been, or will be, tarred for transfer (as the hosts that obtained these locks would not exist in the new environment).

clsAdminTool Commands

The CLS administrative tool consists of the following commands, which can be used in both interactive mode and batch mode:

Command Arguments

filePath

Full path to the file.

directoryHierarchy

The path to the directory hierarchy you want to search for CLS Edit locks.

hostName

The host of the process that owns the locks. For example:

cds111.cadence.com.

If you do not provide the domain name, clsAdminTool takes the domain name from the system you are using. If you do not want clsAdminTool to add the domain name, use the -force command or the -force argument to clsAdminTool.

processID  

The ID of the process that owns the locks.

processCreationTime

The time when the process was created.

You can get this information from the Lock-Stake file, filename.cdslck, which is in the same directory as the locked file.

Related Topics

Changing the CLS Boolean Daemon Port Number

Running the CLS Administrative Tool in Interactive Mode

In interactive mode, the Cadence® locking system (CLS) administrative tool is a shell interface that lets you run one command at a time.

To start the CLS administrative tool in interactive mode,

To display the version number of the CLS administrative tool,

Using the CLS Administrative Tool

After you start the administrative tool, at the > prompt,

In addition, you can use the following commands:

Exiting the CLS Administrative Tool

To exit the CLS administrative tool

Displaying the CLS Administrative Tool Options

To display the arguments you can use with the clsAdminTool command,

Related Topics

clsAdminTool Commands

Using the CLS Administrative Tool in Batch Mode

In addition to using the Cadence® locking system (CLS) administrative tool interactively in a shell interface, you can run it in batch mode on a UNIX command-line.

In batch mode, you can use any of the clsAdminTool commands—ale, aple, are, apre, asre—as arguments to clsAdminTool.

To run the administrative tool in batch mode,

To display the arguments you can use with the clsAdminTool command,

You can also create aliases for clsAdminTool commands and use the alias to call the command. For example:

alias findLocks “clsAdminTool -ale .”

or

alias cleanLocks “clsAdminTool -are .”

To display the version number of clsAdminTool,

Related Topics

CLS Administrative Tool

Troubleshoot Cadence Locking System Problems

Problem: Application hangs on lock request to a remote system

For NFS prior to version 4, check whether the network lock daemons lockd and statd are running on the remote system. lockd and statd must always be running on every UNIX system that runs Cadence applications or stores data. Some applications that use read and write locks use the operating system’s fcntl function, which relies on lockd and statd daemons. (CLS Edit locks no longer use fcntl.) If the daemons are running, but calls to them still hang, verify that you have the latest operating system patches.

Problem: Locking requests to a Linux machine fail with the following error:

“No locks available”

While CLS Edit locks no longer use fcntl, some applications that use read and write locks do use the operating system’s fcntl function. Locking requests to a Linux machine will fail if the Linux NFS server does not support locking.

To solve this problem, upgrade your NFS software to a version that supports locking.

Problem: Failed to obtain lock information on a cellview:

“no data on lock available”

This message appears when the SKILL function geGetLockInfo() fails to obtain lock information from the .cdslck file or there is no lock available on a cellview. For more information, see geGetLockInfo().

Problem: Lock requests fail for files locked by an application running on remote systems

Check whether the Boolean daemon (clsbd) is running on the remote system on which the application is running. The Boolean daemon must always be running on every system that runs Cadence applications. For more information about how to start it, see Starting the Boolean Daemon.

Problem: You cannot start the Boolean daemon or you get the following error:

“Fatal (clsbd): port number xxx is in use by a program that is not clsbd. Exiting.”

Check if another application is using the Boolean daemon’s port number (16723). If another application is using the port number, you might need to change the Boolean daemon’s default port number.

Problem: Your Cadence application does not run and you get the following error:

*Warning* file /usr/xyz/CDS.log Malformed Lock-Stake file.
Failed to lock log file: /usr/xyz/CDS.log

This error message indicates that the Lock-Stake file is either empty or corrupted. A Lock-Stake file can be empty if it was created when the disk was full. A Lock-Stake file can be corrupted if it was manually edited or if the application or system exited abnormally.

Resolve the cause of the problem. If it is safe to remove the lock on the file, remove the Lock-Stake file (filename.cdslck) manually or with clsAdminTool.

Problem: If the machine that a cellview lock is registered to is no longer available, DFII will only inform that the cellview is still locked after a lengthy period of time.

This situation can arise after several minutes of DFII trying to access the cellview, via an exchange with oaFSLockD, only to inform that the cellview cannot be accessed, and remains locked.

You can however reduce the time that will be allowed for such an exchange, using the CLS_CLSBD_CONNECT_TIMEOUT environment variable. For example:

setenv CLS_CLSBD_CONNECT_TIMEOUT 5

where, 5 = 5 seconds.

Related Topics

Changing the CLS Boolean Daemon Port Number

CLS Administrative Tool


Return to top
 ⠀
X