Skip to content
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

STOP_SENDING for a closed or reset stream results in error #3

Closed
Ruben2424 opened this issue Aug 15, 2024 · 6 comments
Closed

STOP_SENDING for a closed or reset stream results in error #3

Ruben2424 opened this issue Aug 15, 2024 · 6 comments
Assignees

Comments

@Ruben2424
Copy link

The h3 repository uses h3spec for tests in ci.
With some changes it displays following error:
https://github.com/hyperium/h3/actions/runs/10340143789/job/28620383129#step:6:1210

        predicate failed on expected exception: QUICException
       TransportErrorIsSent StreamStateError "No such stream for STOP_SENDING"

This is because STOP_SENDING is sent for the request stream after h3-spec closed it (FIN or Reset).

The spec says that a sender could also receive the frames in any state because of delivery delay:
https://www.rfc-editor.org/rfc/rfc9000.html#name-permitted-frame-types

The receiver only sends MAX_STREAM_DATA frames in the "Recv" state. A receiver MAY send a STOP_SENDING frame in any state where it has not received a RESET_STREAM frame -- that is, states other than "Reset Recvd" or "Reset Read". However, there is little value in sending a STOP_SENDING frame in the "Data Recvd" state, as all stream data has been received. A sender could receive either of these two types of frames in any state as a result of delayed delivery of packets.

Also related discussion in quinn-rs/quinn#1965

@kazu-yamamoto kazu-yamamoto self-assigned this Aug 16, 2024
@kazu-yamamoto
Copy link
Owner

Section 19.5 says:

A STOP_SENDING frame can be sent for streams in the "Recv" or "Size Known" states; see Section 3.2. Receiving a STOP_SENDING frame for a locally initiated stream that has not yet been created MUST be treated as a connection error of type STREAM_STATE_ERROR.

So, I should check if the stream is already created.
In your case, the stream is already created but gone, thus STREAM_STATE_ERROR should not be sent.

kazu-yamamoto added a commit to kazu-yamamoto/quic that referenced this issue Aug 18, 2024
@kazu-yamamoto
Copy link
Owner

@Ruben2424 I think this has been fixed.
If you can create the h3spec binary by yourself, I should wait for your testing.
If it is hard, I would like to release a new version of h3spec without your testing.

@Ruben2424
Copy link
Author

@Ruben2424 I think this has been fixed. If you can create the h3spec binary by yourself, I should wait for your testing. If it is hard, I would like to release a new version of h3spec without your testing.

Thanks for fixing it. I will try to build it myself, but i never used Haskell before so i dont know how hard it is. I will let you know if i manage it.

@kazu-yamamoto
Copy link
Owner

As you may know, the fix is done in https://github.com/kazu-yamamoto/quic.
You should use the main branch of quic to build h3spec.

@Ruben2424
Copy link
Author

I managed to build it. And it seems to fix the error. Thanks again for helping me out.

@kazu-yamamoto
Copy link
Owner

h3spec v0.1.11 has been released:
https://github.com/kazu-yamamoto/h3spec/releases/tag/v0.1.11

Thank you for this bug report!

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

No branches or pull requests

2 participants