Description
Describe the problem
A client might make additional cc.arduino.cli.commands.v1.ArduinoCoreService.Init
requests.
For example, Arduino IDE periodically (and on demand) performs the following sequence:
Arduino IDE also makes an Init
request after installing/updating a platform or library.
🐛 If there is a running cc.arduino.cli.commands.v1.ArduinoCoreService.Monitor
process, the Init
request hangs.
To reproduce
Equipment
- Any board or other device that will produce a serial port on your computer.
Demo
- Open a terminal.
- Start the Arduino CLI gRPC daemon:
$ arduino-cli version arduino-cli Version: git-snapshot Commit: 863c1ec36 Date: 2024-10-06T06:54:36Z $ arduino-cli daemon Daemon is now listening on 127.0.0.1:50051 {"IP":"127.0.0.1","Port":"50051"}
- Open another terminal.
- Run the following
grpcurl
command in the new terminal to create a gRPC client instance:$ grpcurl \ -plaintext \ -import-path ./rpc \ -proto cc/arduino/cli/commands/v1/commands.proto \ 127.0.0.1:50051 \ cc.arduino.cli.commands.v1.ArduinoCoreService.Create { "instance": { "id": 1 } }
- Run the following command to initialize the instance:
$ grpcurl \ -plaintext \ -import-path ./rpc \ -proto cc/arduino/cli/commands/v1/commands.proto \ -d '{"instance": {"id": 1}}' \ 127.0.0.1:50051 \ cc.arduino.cli.commands.v1.ArduinoCoreService.Init
- Run the following command to start a Monitor request:
$ grpcurl \ -plaintext \ -import-path ./rpc \ -proto cc/arduino/cli/commands/v1/commands.proto \ -d @ \ 127.0.0.1:50051 \ cc.arduino.cli.commands.v1.ArduinoCoreService.Monitor
- Send the request data to open the available serial port:
❗ Adjust the value ofopen_request.port.address
as is appropriate for the port on your computer.{ "open_request": { "instance": { "id": 1 }, "port": { "address": "COM42", "protocol": "serial" } } }
- Open another terminal.
- Run the following command in the new terminal to reinitialize the gRPC client instance:
$ grpcurl \ -plaintext \ -import-path ./rpc \ -proto cc/arduino/cli/commands/v1/commands.proto \ -d '{"instance": {"id": 1}}' \ 127.0.0.1:50051 \ cc.arduino.cli.commands.v1.ArduinoCoreService.Init
🐛 The reinitialization hangs.
Expected behavior
cc.arduino.cli.commands.v1.ArduinoCoreService.Init
does not hang under any conditions.
Arduino CLI version
Operating system
- Linux
- macOS
- Windows
Operating system version
- Ubuntu 24.04
- macOS Sonoma
- Windows 11
Additional context
I bisected the regression to bb815cf / #2565 (the fault does not occur when using the build from the previous commit 917dcc5).
Originally reported at #2347 (comment) (note the original issue report #2347 was from long before the time of the regression, so is different from the Monitor-specific issue tracked here even if the symptoms are somewhat similar).
Additional reports
cc.arduino.cli.commands.v1.ArduinoCoreService.Init
hangs ifMonitor
is running #2719 (comment)- Exceptionally long duration of "Downloading index: ..." process #2347 (comment)
- Exceptionally long duration of "Downloading index: ..." process #2347 (comment)
- Update or install package hangs on processing state when Serial Monitor/Plotter is open arduino-ide#2562
- ESP Exception Decoder Sketch path is not set dankeboy36/esp-exception-decoder#16 (comment)
- https://forum.arduino.cc/t/downloading-index-package-teensy-json/1229463/7
- https://forum.arduino.cc/t/ide-hangs-on-startup-error-downloading-index/1261030/9
- https://forum.arduino.cc/t/esp32-platform-takes-forever-to-install/1265136/3
- https://forum.arduino.cc/t/ide-2-3-2-very-slow-compiling/1281480/37
- https://forum.arduino.cc/t/compilation-is-delayed-by-downloading-index-package-index-tar-bz2-process/1300983/5
- https://forum.arduino.cc/t/compilation-is-delayed-by-downloading-index-package-index-tar-bz2-process/1300983/6
- https://forum.arduino.cc/t/compilation-is-delayed-by-downloading-index-package-index-tar-bz2-process/1300983/7
- https://forum.arduino.cc/t/compilation-is-delayed-by-downloading-index-package-index-tar-bz2-process/1300983/10
- https://forum.arduino.cc/t/compilation-is-delayed-by-downloading-index-package-index-tar-bz2-process/1300983/11
- https://forum.arduino.cc/t/compilation-is-delayed-by-downloading-index-package-index-tar-bz2-process/1300983/12
- https://forum.arduino.cc/t/compilation-is-delayed-by-downloading-index-package-index-tar-bz2-process/1300983/13
- https://forum.arduino.cc/t/compilation-is-delayed-by-downloading-index-package-index-tar-bz2-process/1300983/15
- https://forum.arduino.cc/t/compilation-is-delayed-by-downloading-index-package-index-tar-bz2-process/1300983/16
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/1
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/2
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/3
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/6
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/14
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/17
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/19
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/20
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/21
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/22
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/28
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/36
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/38
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/40
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/41
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/44
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/45
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/50
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/51
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/55
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/58
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/60
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/62
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/63
- https://forum.arduino.cc/t/after-upgrading-to-v2-3-3-stuck-downloading-index/1305575/64
- https://forum.arduino.cc/t/installing-a-library-never-finishes-if-a-board-is-connected/1305779/1
- https://forum.arduino.cc/t/installing-a-library-never-finishes-if-a-board-is-connected/1305779/3
- https://forum.arduino.cc/t/library-and-board-updates-stall-after-2-3-3-auto-update/1305826/1
- https://forum.arduino.cc/t/library-and-board-updates-stall-after-2-3-3-auto-update/1305826/3
- https://forum.arduino.cc/t/library-and-board-updates-stall-after-2-3-3-auto-update/1305826/4
- https://forum.arduino.cc/t/library-and-board-updates-stall-after-2-3-3-auto-update/1305826/7
- https://forum.arduino.cc/t/library-and-board-updates-stall-after-2-3-3-auto-update/1305826/11
- https://forum.arduino.cc/t/ide-2-3-3-stuck-trying-to-download-teensy/1306012/1
- https://forum.arduino.cc/t/ide-2-3-3-stuck-trying-to-download-teensy/1306012/7
- https://forum.arduino.cc/t/ide-2-3-3-stuck-trying-to-download-teensy/1306012/16
- https://forum.arduino.cc/t/ide-2-3-3-stuck-trying-to-download-teensy/1306012/25
- https://forum.arduino.cc/t/package-esp32-index-json-hangs-up-loading/1306784/1
- https://forum.arduino.cc/t/package-esp32-index-json-hangs-up-loading/1306784/4
- https://forum.arduino.cc/t/package-esp32-index-json-hangs-up-loading/1306784/5
- https://forum.arduino.cc/t/package-esp32-index-json-hangs-up-loading/1306784/8
- https://forum.arduino.cc/t/package-esp32-index-json-hangs-up-loading/1306784/10
- https://forum.arduino.cc/t/package-esp32-index-json-hangs-up-loading/1306784/12
- https://forum.arduino.cc/t/package-esp32-index-json-hangs-up-loading/1306784/21
- https://forum.arduino.cc/t/package-esp32-index-json-hangs-up-loading/1306784/22
- https://forum.arduino.cc/t/download-index-package-lgt8fx-index-json-stuck/1307014
- https://forum.arduino.cc/t/downloading-index-package-adafruit-index-json-error-solved/1307083/1
- https://forum.arduino.cc/t/downloading-index-package-adafruit-index-json-error-solved/1307083/10
- https://forum.arduino.cc/t/downloading-index-package-adafruit-index-json-error-solved/1307083/11
- https://forum.arduino.cc/t/ide-2-3-3-stuck-for-infinity-build-the-sketch-download-the-package-index/1311902
- https://forum.arduino.cc/t/library-update-hangs/1316825
- https://forum.arduino.cc/t/rtc-ds1307-and-adafruit-i2cdevice-libraries-errors/1323406/6
- https://forum.arduino.cc/t/arduino-stuck-on-compile-and-wont-work-anymore/1323725
- https://forum.arduino.cc/t/ide-hangs-while-downloading-index-package-rp2040/1324320
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the nightly build
- My report contains all necessary details