QuicheQuicStreamChannel does not properly handle QUICHE_ERR_DONE

Open
#15,924 5 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

  • #16917 by @schiemon — closed without merging

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
java
Domain
networking

Research direction

Start with QuicheQuicStreamChannel's handling of quiche_conn_stream_send results, then inspect QuicStreamShutdownTest#testShutdownInputClosureCausesStreamStopped and its shutdown sequence. Reproduce the described write after input shutdown and verify that QUICHE_ERR_DONE fails the promise and updates the stream channel lifecycle; also assess how output shutdown should be exposed.

Written by the indexing model from the issue text.

Description

When writing a buffer, quiche_conn_stream_send can return QUICHE_ERR_DONE which implies the buffer could not be written because the stream is considered as closed and therefore the associated promise should be failed, most likely an event should be emitted as well.

Steps to reproduce: modify QuicStreamShutdownTest#testShutdownInputClosureCausesStreamStopped such as

  • replace channelRead reaction by userEventTriggered reacting to ChannelInputShutdownEvent with a buffer write to the stream
  • the remote side now should perform the sequence
    • stream write and flush (creates the stream)
    • shutdown input (which sends a stop sending frame, with which Quiche will respond with a reset frame)
    • shutdown output (which sends a stream frame with fin bit set)

Since output is shutdown, Quiche does not handle report the write as a QUICHE_ERR_STREAM_STOPPED error but instead considers the stream is closed and reports QUICHE_ERR_DONE.

Technically the stream is closed (both ways are shutdown), I can see two issues here

  1. the write promise should be failed (like with QUICHE_ERR_STREAM_STOPPED)
  2. this should be update the stream channel lifecycle

Another concern, as it stands the only way to detect output shutdown (because a STOP_SENDING frame was received) is with a stream write operation that signals QUICHE_ERR_STREAM_STOPPED or QUICHE_ERR_DONE, which does not seem ideal for developing application protocols.

This echoes the concern I raised in the reset issue.

Dominant language
Java
Stars
35.1k
Forks
16.4k
Avg merge
1d 1h
Merged PRs (30d)
385

Getting set up

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 netty/netty

All issues in netty/netty

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.