Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug on taking control of a device: set a lock for exclusive access #650

Merged

Conversation

denis99999
Copy link

It fixes the #620 issue at API level

@denis99999 denis99999 closed this Apr 3, 2023
@denis99999 denis99999 deleted the add-api-lock-on-taking-device branch April 3, 2023 16:53
@denis99999 denis99999 restored the add-api-lock-on-taking-device branch April 3, 2023 17:22
@denis99999 denis99999 reopened this Apr 3, 2023
Signed-off-by: Denis barbaron <[email protected]>
@koral-- koral-- merged commit 51b86a8 into DeviceFarmer:master Apr 3, 2023
@jupe
Copy link

jupe commented Jan 17, 2025

@koral-- seems that this is still an issue. We will investigate a bit more and create follow-up ticket for this.

@denis99999
Copy link
Author

@jupe, I have tested this PR extensively and haven't seen any other issues, can you describe the issue you are experiencing? Are you sure that your client side is not at fault?

@denis99999
Copy link
Author

@jupe, I took a look at the code and I seem to have seen a vulnerability, I'm taking the point to investigate and fix the problem! For your part, what exactly is the problem you are experiencing?

@jupe
Copy link

jupe commented Jan 17, 2025

multiple parallel test job try to
lock same device and sometimes when time is right, two client get same device and problems starts, eg ”No longer owned by..”

most probably this script reproduce issue: #620

denis99999 added a commit to denis99999/stf that referenced this pull request Jan 20, 2025
@denis99999
Copy link
Author

@jupe , can you test this PR #824 and let me know if it fixes your issue?

koral-- pushed a commit that referenced this pull request Jan 20, 2025
@jupe
Copy link

jupe commented Jan 21, 2025

@jupe , can you test this PR #824 and let me know if it fixes your issue?

Thanks for investigating this @denis99999 . I’ll test this as soon as possible. Note that I’m still using 3.7.1 release and a bit afraid to upgrade 3.7.2 since it introduces so many changes. Have to finally jump to it :)

@jupe
Copy link

jupe commented Jan 27, 2025

so far seems to work fine. One (a bit related) improvement idea for tracing - when automatic leave functionality is triggered, it doesnt trace reason which would be useful;

log.important('No longer owned by "%s"', group.email)

michal-murin pushed a commit to wandera/devicefarmer-stf that referenced this pull request Jan 28, 2025
michal-murin pushed a commit to wandera/devicefarmer-stf that referenced this pull request Jan 28, 2025
michal-murin pushed a commit to wandera/devicefarmer-stf that referenced this pull request Jan 28, 2025
@denis99999
Copy link
Author

so far seems to work fine. One (a bit related) improvement idea for tracing - when automatic leave functionality is triggered, it doesnt trace reason which would be useful;

@jupe, the 'No longer owned..' message is normal and is traced when the device is released either by the one who previously took control of it, or by the admin, or by the device reservation mechanism who can preempt a device, we could indeed indicate the cause but what is the point of such an effort?

@jupe
Copy link

jupe commented Feb 3, 2025

it would help investigations when such issue happens. Reason would identify root cause clearly.

Probably not directly related, but we have strange issue when phone disconnect from USB hub causes that also other phones adb connections break on the same host. I’ve to investigate that more, but do you have any idea what could causes that?

@denis99999
Copy link
Author

@jupe ,

it would help investigations when such issue happens. Reason would identify root cause clearly.

You can suggest a PR but honestly it doesn't seem essential to me

Probably not directly related, but we have strange issue when phone disconnect from USB hub causes that also other phones adb connections break on the same host. I’ve to investigate that more, but do you have any idea what could causes that?

Yes, this looks like a hardware issue, you should at least make sure you are using a USB 2.0 hub (and not 3.x as it seems STF supports it poorly) and preferably connect it to your host's USB 2.0 port, You also need to make sure your host has enough USB channels. available

michal-murin pushed a commit to wandera/devicefarmer-stf that referenced this pull request Feb 5, 2025
@jupe
Copy link

jupe commented Feb 9, 2025

@jupe ,

it would help investigations when such issue happens. Reason would identify root cause clearly.

You can suggest a PR but honestly it doesn't seem essential to me

Probably not directly related, but we have strange issue when phone disconnect from USB hub causes that also other phones adb connections break on the same host. I’ve to investigate that more, but do you have any idea what could causes that?

Yes, this looks like a hardware issue, you should at least make sure you are using a USB 2.0 hub (and not 3.x as it seems STF supports it poorly) and preferably connect it to your host's USB 2.0 port, You also need to make sure your host has enough USB channels. available

seems that latest release fixes this issue. Reproduce every time with earlier release. Didn't find any obvious reason why it happens/how it get fixed.

@denis99999
Copy link
Author

@jupe , interesting, perhaps it is due to the upgrade to adbkit 3.x, I will make tests with a USB 3.x Hub to check if it we gain in stability!

@jupe
Copy link

jupe commented Feb 9, 2025

note that I did have USB 2.0 usb hub. Reproduced even with 2 phones - when pressing reboot from UI, another reserved phone connection dropped as well.

@denis99999
Copy link
Author

so mystery

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants