If my workflow saves to /tmp/foo.txt, is that threadsafe? ie if 2+ executions are running, do they have their own /tmp, or do simultaneous requests share /tmp?

This topic was automatically generated from Slack. You can find the original thread here.

Raymond Camden : Ok, this question will NOT be dumb: If my workflow saves to /tmp/foo.txt, is that threadsafe? ie if 2+ executions are running, do they have their own /tmp, or do simultaneous requests share /tmp ?

Dylan Sather (Pipedream) : Requests that truly run in parallel run in their own VMs, and will not share /tmp.

When the VM stops servicing a request, it’ll stay alive to keep handling future requests, and the contents of /tmp from the previous execution remain until the VM dies.

If you think that might bite you, you can serialize the execution of your workflow and make sure to clean up /tmp at the top of the workflow to start fresh.

Raymond Camden : im migrating some code that uses nanoid to make a unique name, so i’ll just keep using that

Dylan Sather (Pipedream) : yes that should work