hilbert / hilbert-cli

Backend management tools: CLI
Apache License 2.0
6 stars 2 forks source link

Reject any command execution that might interfere with another command currently executed in parallel #55

Closed porst17 closed 6 years ago

porst17 commented 6 years ago

What happens if several hilbert station commands (targeting the same station) are executed in rapid succession or even in parallel? Same with any other station or server command I might not think of right now.

malex984 commented 6 years ago

DONE: all configuration-depending commands will place a global execution lock!

Moreover due to further work on hilbert-station (recursive self-call) one will also be able to switch-off the locking.

porst17 commented 6 years ago

Where are the locks stored? On the station or on the server? What does global mean in this context?

For hilbert-station, you mean that the recursive call will not lock anything, right?

malex984 commented 6 years ago

it is about running hilbert-station on some station. To prevent parallel execution it creates a lockfile on the system. It may be located in one of the following places: /var/run/hilbert /var/run/lock/lockdev /run/lock/lockdev /var/run/lock /run/lock /var/run /run /tmp/, depending on which one exists and write-able.

porst17 commented 6 years ago

So I assume that hilbert-station return a non-zero exit status if it detects another lock. What does hilbert on the server do in such a case? Just report the error to the caller?

malex984 commented 6 years ago

AFAIR hilbert on the server-side just gets the error exit code and returns an error in that case (possibly with a special exit code)

porst17 commented 6 years ago

Is it possible that the lock stays unreleased in case of a crash of hilbert-station? Is there a well-defined way to clean it up (i.e. for hilbert on the server and therefore also for hilbert-ui)?

porst17 commented 6 years ago

I just noticed that @malex984 didn't answer my question.