-
Notifications
You must be signed in to change notification settings - Fork 28
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
next_complete waiting forever although the completion callback has been emitted #89
Comments
Hmm, if you are able to dive in and troubleshoot this, here's a tour of the code involved. You're seeing this log message: nusb/src/platform/macos_iokit/transfer.rs Lines 21 to 36 in c4395fe
When that calls Lines 176 to 196 in c4395fe
The waker should have been previously registered here, which means that async task should wake up and poll again, and find the transfer in STATE_COMPLETED Lines 128 to 144 in c4395fe
You could start by adding additional logging to these (or using a debugger) to see which of those steps is not happening. |
Hi, I've added logging in the function
The I would appreciate your further guidance. thanks |
You should expect to see If it is not being called at all, I have to suspect that the returned future is not properly being polled. The path from Lines 158 to 192 in c4395fe
The only thing I could see going wrong there is if What executor are you using / how are you polling the future or the future that |
This was not clear in my first message, but this problem arises rarely: it hangs after thousand of successful transfers. From what I see in successful transfers, the From what I understand, when it hangs, the How would the transfer complete out of order? How could I check that? I am used tasks from the iced gui, but it uses tokio under the hood. A thread is dedicated to the queue await s. I poll the future with functions similar to the one in the first code snippet of the first message. I have one such function for each stage of the transfer (3 functions in total, but all very similar). |
I found a race condition that could lead to lost wakeups. Can you try #92? |
I cherry-picked the last commit from that branch and it seems to solve the issue (I waited for about 10 min when it was hanging in the first few minutes usually). |
Fix released in v0.1.12 |
Hi,
I am trying to use nusb with the cameleon library for usb3 cameras. Sometimes, the program hangs because the next_complete method never returns.
Here is how I read the packets:
I checked that no error is returned and that the program hangs on the await.
Here is a log where the packets are well received for a transfer and then it hangs for the next one.
Is there something I should pay attention to?
The text was updated successfully, but these errors were encountered: