Canceling compilation or upload doesn't kill tool process #2517
Labels
conclusion: resolved
Issue was resolved
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Describe the problem
When a compile, upload, or burn bootloader operation is triggered by the Arduino IDE user, command line tool(s) (e.g., avr-gcc, AVRDUDE) are invoked. It is these tools that actually perform the compilation, upload, or burn the bootloader.
A "CANCEL" button was added to the compile, upload, and burn bootloader progress notifications (#2334 / 2a325a5). Clicking this button cancels the operation in the Arduino IDE GUI, but doesn't kill the tool process. The tool process continues to run just as it would have done if the button had not been pressed
🐛 The button is misleading, since the user is sure to have the reasonable expectation that the tool process will be canceled.
🐛 This can cause very confusing problems when the user triggers a new operation and it has a collision with the process that was still running from the canceled operation. Normally the existence and status of an ongoing process would be communicated to the user via the Arduino IDE UI, but after using the "cancel" feature, there is no such communication. So it will be difficult for the user (and those who support their report) to understand why this is happening.
To reproduce
Equipment
Demo
ⓘ This board was chosen arbitrarily as one that is installed by default and likely to produce a relatively long duration upload process (in order to ensure it will still be running when the second upload is triggered). But the fault is not limited to this board.
🐛 The upload fails with an unexpected "
Access is denied.
" error. The reason is that theavrdude
process from the first upload operation that was triggered at step (4) was still running, even though that operation was canceled.Expected behavior
The process is killed when the "CANCEL" button is clicked.
- OR -
If it is not possible to kill the process, then remove the misleading "CANCEL" button.
Arduino IDE version
2.3.3
Operating system
Operating system version
Additional context
I used the collision of port usage in the demo as a simple and dramatic way to show that the
avrdude
process from the "canceled" upload was still running. However, you can also use a tool such asps -e
on POSIX systems or Windows Task Manager to verify that the process continues running even after the operation is canceled.Related: #1199
Issue checklist
The text was updated successfully, but these errors were encountered: