I'm sorry, I must have misunderstood you. They are both trying to use venv from the cache. Let's say I need to run 10 identical nodes at the same time. The necessary ven is already in the cache. They are independent of each other, but have the same set of libraries. This venv from the cache is suitable for all of them. But only 1 node will copy it. Everyone else will start doing exactly the same venv, as if it is not in the cache.
only one of them uses an already created venv from cache for this task. And the other node starts to re-create the same virtual environment.
Just be clear, the second one is running, but it does not use the same venv as the other one (that is running in parallel), is that correct?
This is by design, they cannot use the exact same venv because if the code starts creating files/change them it happens inside the venv and might cause them to crash.
That said if you are running with venv cache, the first one will create the venv and the second one will create a copy from the cache.