Skip to content

Unify File Locking Across Domains #251

@emmacasolin

Description

@emmacasolin

Specification

Previously we were using the proper-lockfile library to lock and unlock the session file during CLI calls, however, we have recently switched over to using the much simpler (and newer) fd-lock for this purpose. However, proper-lockfile is still being used for the agent lockfile, so we should change this to use fd-lock instead in order to unify our file locking across all domains.

Since fd-lock currently only has a lock() and unlock() command (and no way of checking if a file is locked without attempting to lock it or blocking access to a locked file) we will most likely need to look into the Node C++ bindings and the POSIX manual in order to adapt the library to our needs.

Additional context

See #236, where fd-lock was incorporated into the sessions domain.

Tasks

  • Look into the Node C++ bindings and POSIX manual
  • Make changes to the fd-lock library to meet our requirements
  • Replace proper-lockfile usage with fd-lock in the agent lockfile
  • Test that these changes have not affected functionality in any way

Metadata

Metadata

Assignees

Labels

developmentStandard developmentenhancementNew feature or requestwontfixThis will not be worked on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions