labgrid
labgrid copied to clipboard
make deditec_relais8 thread safe
Description
Fixes Bug, when using the deditec_relais_8 in parallel it would crash with USB Resource Busy
this is fixed by creating a lock file and checking when getting and setting status if the resource is currently in use by annother labgrid thread or process
I've tested this in my local setup where multiple devices are tested in parallel via a shell script that executes pytest
Wouldn't it be easier to catch the exception and try again for a limited amount of times?
yes it would be simpler, but it seems like a janky solution IMO (but I could be wrong here 😄 ). Call me paranoid, but it could happen e.g. for 5 times in a row the device could (very unlikely, but still possible) be busy, here it waits until it gets hold on the lockfile. I just thought of a solution that would be as reliable as possible
Hi @danielschickmunit, do you think you will find time for this?
hi, I'm @danielschickmunit
Unfortunatly I do not longer have access to the Github account of my old work and the HW, so I'm not able to continue working on this PR. Sry for the late response.
@ka98 If you're willing to work on this, simply create a new PR mentioning this. We can then close this.
If you're still interested in this, we can re-open this or create a new PR. Closing this for now.