Skip to content

Trying to kill a discovery process on Windows might fail with a TerminateProcess access is denied #1587

Closed
@silvanocerza

Description

@silvanocerza

Bug Report

Current behavior

I only verified this behaviour when running the arduino-cli in daemon mode.
It probably happens also when running a CLI command but it should not affect the end user in that case since the discovery processes would quit in any case.

This line returns an error so the CLI doesn't consider the discovery process to be closed.

This prevents the quit message to be sent to any client listening for boards connection and disconnection event, so these client won't know they must restart the board list watch process and listen from a new communication channel, thus the clients won't see any more events.

The quit message has been added with #1460.

Expected behavior

I expect the discovery process to be killed only if it's still running.

Environment

  • CLI version (output of arduino-cli version): 0.20.2
  • OS and platform: Windows

Additional context

My guess is that it's failing because the process we're trying to kill already has quit, we should probably only kill it if it's still running.

Metadata

Metadata

Labels

conclusion: invalidIssue/PR not validos: windowsSpecific to Windows operating systemtopic: codeRelated to content of the project itselftopic: gRPCRelated to the gRPC interfacetype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions