Skip to content

[serial-monitor][gRPC] Unhandled EINTR error leaves the serial port opened #504

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

Closed
kittaakos opened this issue Dec 3, 2019 · 1 comment · Fixed by #507
Closed

[serial-monitor][gRPC] Unhandled EINTR error leaves the serial port opened #504

kittaakos opened this issue Dec 3, 2019 · 1 comment · Fixed by #507

Comments

@kittaakos
Copy link
Contributor

kittaakos commented Dec 3, 2019

Bug Report

Current behavior

There are two issues here:

  • select and read can throw the following errors: EINTR, EAGAIN, and EWOULDBLOCK . These should be handled in go-serial and the CLI should recover and continue on such errors.
  • Once we hit an error, the serial port is not closed, hence the connected clients have no chance to reconnect. The port will be busy. See the corresponding code:
    case err := <-targetClosed:
    return err

Expected behavior

EINTR, and EAGAIN should be handled. After an error, clients can open a new client streaming duplex for the serial monitor.

Environment

  • CLI version (output of arduino-cli version): From source
  • OS and platform: 10.15.1 (19B88)

Additional context

@kittaakos
Copy link
Contributor Author

This was reported independently by a PRO IDE user: arduino/arduino-pro-ide#157

cmaglie added a commit to cmaglie/go-serial that referenced this issue Dec 3, 2019
This has been observed in particular on MacOS, in this case just retry
the call without throwing the error back to the user.

Related to:
arduino/arduino-cli#504
arduino/arduino-pro-ide#157
cmaglie added a commit to cmaglie/arduino-cli that referenced this issue Dec 3, 2019
Includes a fix to serial.Read method.

Should fix: arduino#504

Actual patch: bugst/go-serial#69
cmaglie added a commit that referenced this issue Dec 6, 2019
… port open (#507)

* Update go-serial library to latest version

Includes a fix to serial.Read method.

Should fix: #504

Actual patch: bugst/go-serial#69

* Using versioned release of go.bug.st/serial
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants