platformsh / cli

The unified tool for managing your Platform.sh services from the command line.
https://docs.platform.sh/administration/cli.html
MIT License
19 stars 6 forks source link

Concurrency issues with the temporary packages & lock files #47

Open Nh640 opened 1 year ago

Nh640 commented 1 year ago

Hello everybody,

I've come across with an issue on a Linux server where multiple users are using the Platform.sh CLI utility. When two or more of them try to use its commands simultaneously, only one of them gets the lock and temporary files ownership, so that user is the only one that is able to use the utility. The problem here is that the same temporary folder is used for everybody (/tmp), as it is specified in the code:

Is it possible to set a temporary path related to the user that is executing the utility?

Thanks a lot.

akalipetis commented 1 year ago

Thanks for the report @Nh640 - this is indeed a very interesting issue that we haven't thought of. We'll probably add the user ID in the path there as well to fix the issue.

Have you tried any workarounds? In theory, you could set a different TMP_DIR for each user, but that's definitely not ideal.

What's the use case of multiple users using the CLI on the same server btw? Mostly asking to see what other use cases we could potentially cover.

Nh640 commented 1 year ago

Thanks for the suggestion, I've tried to find a workaround for the problem but I didn't think about changing TMP_DIR. Indeed it should do the trick for the moment.

I give support to a small team of developers that connect the IDEs installed on their laptops to a remote server where they have all the tools they need to build & deploy their code. One of these tools is Platform.sh CLI.

akalipetis commented 1 year ago

Thanks a lot, @Nh640 for getting back to us. This seems like a solid use case and indeed if you use the CLI from multiple users this might pose issues. I'll leave this open so that we can make sure the CLI can be run without issues from multiple users.