Skip to content

Protect from running parallel commands #460

Description

@nirs

Testing with agent shows that they are creative and sometimes ignoring instructions.

We had these cases:

  • Cursor running ramenctl validate application for 2 application in parallel. This overload the server and make it hard to present test results.
  • Bob running ramenctl test run and ramenctl test clean in parallel after timeout. This creates lot of mess and may lead to 2 processes writing to the same files.

We cannot ensure this does not happen with both agents (ignore instructions) and humans (do not read instructions). The safe way is to ensure that one command is using the output directory at the same time with a lock file.

Locking the output directory

Right after crating the output directory, the command can take an exclusive lock on the directory. Starting second command will fail with a clear message without modifying any file.

Safe commands (e.g. test progress #459) do not ned to take a lock since they do not modify the output directory.

Implementation

lima-vm lockutil uses lock on a directory in a portable way:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions