-
Notifications
You must be signed in to change notification settings - Fork 4
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
Blocking on write in MacOS #9
Comments
Hey! Thank you for opening an issue. How much data are you trying to write and how long does it block? If you send enough data to fill the kernel buffers, then it should block. So we need to figure out if this is what is happening. |
Also note that there was a bugfix recently that may be related to this: #7 So if you're not on |
So I did just bump to 0.1.12, now it no longer blocks but I'm seeing "Error writing command: Elapsed(())". This happens immediately and for every variation of write. Also tried multiple adapters. It does not happen when using a socat virtual port (pipe) |
Removing the tokio layer, I get Error writing command: Kind(TimedOut) on the serial2 lib alone, mabye I should move this over there. |
Would it be possible to share your code and the details of your serial converter and the device you're trying to communicate with?
|
You're correct, it is a tokio timeout because otherwise it will just block the thread forever. Still unsure whats causing this but if its any help, with the changes you made in .13, now it won't open a port at all:
Results in:
I've tried several USB adapters, settings, and running under sudo. Even on a very minimal app with literally only that line, I'm getting the same error. Maybe something with the USB/serial driver? I've tried every variation I have laying around with no luck. I've also tried virtual ports just for the sake of troubleshooting, but they aren't recognized as a valid TTY:
|
Just for completeness:
from lock file
I'm on an M3 running Sonoma 14.7.1, but same thing before I upgraded last week from Ventura. |
Ah, I think that problem was introduced with de-vri-es/serial2-rs#39. Sadly it is difficult for me to properly test on macOS, so this slipped past. There should be a fix open in de-vri-es/serial2-rs#45, but I would really like someone to verify if it works before I release it :] /edit: ah, I see you already found that thread. Still good to know for other people reading this issue though :) |
I just released |
Curious if anyone is running into this? Writing shouldn't block but it is. When writing to a pipe on MacOS or a serial port on a linux device, no issue. But during development I'm using a usbserial adapter and its blocking on port.write() and I don't understand why.
The text was updated successfully, but these errors were encountered: