-
Notifications
You must be signed in to change notification settings - Fork 1
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
Weird Asyncio errors on raspberry pi #8
Comments
@hemna if you have a chance, would you post the python interpreter versions and do a Also, if you have a reproducer that I can run to replicate this, I'd appreciate it. From the trace, it looks like the interpreter is exiting at the time I'm suspecting that python/cpython#86813 may be related. |
Hi, I have tried the apt provided python, which is 3.9.2, but I also have tried pyenv installs of 3.8.16 and 3.10.9.
|
just a note that recent |
@hemna can you post a minimal aprsd config that reproduces this issue for you? I checked out
I'm using a config that explicitly sets (the only change I made was fixing the pin for cryptography==38.0.1, so I didn't need a rust compiler) |
yah cryptography sucks because of it being rust based and rust builds consistently puke on arm base systems. I don't have a current paired down reproducer of this. what version of aprsd are you using? I'm working off of master as it will be 3.0.0 fwiw, aprsd is what is driving the APRS REPEAT service here: |
I just tried to reinstall after editing requirements.txt to pin cryptography to 38.0.1
Here is what I'm doing
|
my ~/.config/aprsd/aprsd.conf I have direwolf running on the same host that I'm running aprsd on, hence host is set to localhost
|
Fascinating, that looks almost exactly like the setup that I tried. 🤔 What kind of pi are you using? What OS? 64-bit? And if you have an extra SD card I'm curious if you can reproduce on the latest raspi os? I'll try again after work with your exact steps and OS and see if I can repro. |
I am trying on a raspi 3b+
|
I'm also now having to pin additionally with all that said, repro is achieved via
This is on a raspi 4B with the latest OS + updates
Interestingly, when I remove the Can you try without the |
I made a small change for debugging
and now the traceback is slightly different, but to the same tune
Looking at the code
that
So I added a call to
And it occurs before
With this new insight, it was clear to me that the Adding some code like the following can "beat the race"
The raspi is slow enough to expose this race condition that was probably not observed on other, faster platforms. However, I'm not sure just adding a sleep is the best way to proceed. I admittedly don't do much direct work with threading in python these days, but I think general practice is to keep the I would probably refactor away the explicit SIGINT handling, and instead replace that with a wait on some As for this issue, I'm not seeing any immediate code fix needed on the |
wow, thanks so much for the really in depth debugging of this. I was a bit stumped and it seemed there was an issue with asyncio, but clearly I messed up and failed to recognize the obvious here. You are exactly correct the main thread doesn't wait for all the other threads to complete before it bails. I have added a simple join() to one of my long running threads and that has solved it. Crazy stupid error on my part. I had been testing on my macbook pro and linux HP dl360 server for ages and hadn't run into this until I tested it on the rpi3. I also didn't notice that shellingham was yanked from pypi. that must have been done recently as I have been updating the requirements.txt from the requirements.in (via make update-requirements). I don't really get asyncio, as I'm a threading person....or at least I thought I was until this error! lol. Thanks a million. |
(Original issue report received via email)
I am using your release of kiss python library kiss3 here:
https://github.com/python-aprs/kiss3
I'm integrating it into my aprsd packet daemon:
https://github.com/craigerl/aprsd
It generally works fine, but I am running into weird asyncio errors on my raspberry pi debian.
I have run this exact code on macos as well as linux x86 w/o problems, but raspi fails.
when I try and start the kiss interface I get this:
The text was updated successfully, but these errors were encountered: