jborean93 / pypsexec

Remote Windows execution like PsExec on Python
MIT License
119 stars 38 forks source link

Race condition with Windows deleting service and next execution #57

Open rsdoherty opened 1 year ago

rsdoherty commented 1 year ago

Hey,

I have an app that runs against devices using pypsexec, and on occassion the next execution occurs before Windows has deleted the old service.

Would it be possible to move away from using PID + current host (the same Celery worker processes the message, so the service name ends up being the same)?

Looking through the code we could accept a custom service name when instantiating the Client object, but then that might impact the StdOut/StdErr pipes?

Happy to PR myself, but would appreciate thoughts on the above first. Perhaps moving to a unique UUID instead of PID and host?