-
-
Notifications
You must be signed in to change notification settings - Fork 403
Python process left running if an installed platform uses a Python script-based pluggable discovery tool #2867
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
Comments
Windows Python doesn't seem to kill the worker Thread properly when the IDE is exited, leading to a) multiple Python3 instances on a PC after many uses and b) errors updating the core when it tries to re-install Python3 while still having the older version's EXE loaded and in use. Works around arduino/arduino-cli#2867
Windows Python doesn't seem to kill the worker Thread properly when the IDE is exited, leading to a) multiple Python3 instances on a PC after many uses and b) errors updating the core when it tries to re-install Python3 while still having the older version's EXE loaded and in use. When an exception happens on the input() call under Windows, it seems like it can still leave a thread running. Add one more flag, caught in a global exception handler. Works around arduino/arduino-cli#2867
This may not be an issue related to the IDE so much as one related to the implementation of Windows Python Threading class. We use The UF2 scanner I whipped up one morning after reading the spec since it didn't seem to be built-in (maybe the new IDE includes UF2 scanning already and this can be dropped?). It uses Python I think there was an interaction with the I've tested earlephilhower/arduino-pico#2853 on Linux and Win11 and have not seen any dangling @rei-vilo can you replace your copy of |
@earlephilhower Thank you very much for your prompt answer and congratulations for the solution. With I am thus closing the issue. |
Windows Python doesn't seem to kill the worker Thread properly when the IDE is exited, leading to a) multiple Python3 instances on a PC after many uses and b) errors updating the core when it tries to re-install Python3 while still having the older version's EXE loaded and in use. When an exception happens on the input() call under Windows, it seems like it can still leave a thread running. Add one more flag, caught in a global exception handler. Works around arduino/arduino-cli#2867
Thanks for the report! Merged the PR in the core. |
Describe the problem
Arduino CLI allows boards platforms to use custom "pluggable discovery" tools.
The "Raspberry Pi Pico/RP2040" boards platform uses a custom pluggable discovery. This discovery is a Python script, which is executed via the Python interpreter:
https://github.com/earlephilhower/arduino-pico/blob/e60858c327690222594a8b35bc65f68e52491c5c/platform.txt#L119-L123
🐛 The Python interpreter process that is created by Arduino CLI is not terminated on exit. This results in an accumulation of such processes over time.
To reproduce
🐛 A
python3.exe
process is left running after each command that causes Arduino CLI to invoke therp2040:rp2040
platform's pluggable discovery tool.Expected behavior
Clean exit of Arduino CLI with no zombie threads.
Arduino CLI version
a39f9fd
Operating system
Windows
Operating system version
11
Additional context
Discussion: https://forum.arduino.cc/t/closing-ide-2-3-2-leaves-python-32-bit-running/1283853
Issue checklist
The text was updated successfully, but these errors were encountered: