labgrid icon indicating copy to clipboard operation
labgrid copied to clipboard

make deditec_relais8 thread safe

Open danielschickmunit opened this issue 2 years ago • 2 comments

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

danielschickmunit avatar Jun 09 '22 09:06 danielschickmunit

Wouldn't it be easier to catch the exception and try again for a limited amount of times?

Bastian-Krause avatar Jun 09 '22 14:06 Bastian-Krause

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

danielschickmunit avatar Jun 14 '22 08:06 danielschickmunit

Hi @danielschickmunit, do you think you will find time for this?

Emantor avatar Jan 25 '23 09:01 Emantor

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 avatar Sep 27 '23 07:09 ka98

@ka98 If you're willing to work on this, simply create a new PR mentioning this. We can then close this.

Bastian-Krause avatar Oct 04 '23 10:10 Bastian-Krause

If you're still interested in this, we can re-open this or create a new PR. Closing this for now.

Bastian-Krause avatar Dec 15 '23 15:12 Bastian-Krause