wsutil ExecReaderToChannel drops buffered output on HUP-only events

Open Beginner friendly
#1,069 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go

Research direction

Start at the Linux reader loop in ExecReaderToChannel and trace how POLLHUP/POLLRDHUP events are handled after a partial read. Add coverage for a HUP-only event with buffered output, and consider the issue done when pending bytes are flushed before the loop returns.

Written by the indexing model from the issue text.

Description

In the Linux reader loop, a POLLHUP/POLLRDHUP event without POLLIN returns before flushing an already accumulated partial buffer. A prior read can leave offset > 0 when the buffer is larger than the data available; the subsequent HUP-only event then discards those bytes. The HUP path should flush pending output before returning.

Dominant language
Go
Stars
207
Forks
80
Avg merge
2d 15h
Merged PRs (30d)
23

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from canonical/pebble

All issues in canonical/pebble

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.