Skip to content

RFC: More granular locking #199

@chrboe

Description

@chrboe

Currently (as of #140), targetcli takes a global /var/lock/targetcli.lock. This poses a problem when combined with interactive mode because the lock will be taken the entire time the targetcli shell is open.

When an administrator leaves a targetcli shell open (perhaps even unknowingly in some SSH session or screen in the background), this effectively means that no targetcli operations can be completed, leading to disastrous consequences when a cluster manager such as Pacemaker is involved. In the event of a failover, the iSCSI target cannot start on the new primary node.

We have observed this behavior leading to user confusion and – in one instance – even an actual production outage.

My proposal is: when running in interactive mode, only take the global lock when some action is actually running.
When the shell is just sitting there idly, there is no need to take the lock.

Of course, this implies a potentially unwanted behavioral change (hence the request for comments from the maintainers): in the current version, it is guaranteed1 that the state won't change while an interactive shell is open.

Please let me know your thoughts about this issue.


1 As guaranteed as it can be, considering you could still manually mess around in the configfs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions