Skip to content

onCodecLowLevelReset will be called multiple time for same stream #42264

Closed as not planned

Description

@wbpcode

If you are reporting any crash or any potential security issue, do not
open an issue in this repo. Please report the issue via emailing
[email protected] where the issue will be triaged appropriately.

Title: One line description

Description:

What issue is being seen? Describe what should be happening instead of
the bug, for example: Envoy should not crash, the expected value isn't
returned, etc.

After the #37784, the onCodecLowLevelReset will be called multiple for non-zero code.

First, it will be called at:

void ConnectionImpl::StreamImpl::resetStreamWorker(StreamResetReason reason) {
  if (stream_id_ == -1) {
    // Handle the case where client streams are reset before headers are created.
    // For example, if we send local reply after the stream is created but before
    // headers are sent, we will end up here.
    ENVOY_CONN_LOG(trace, "Stream {} reset before headers sent.", parent_.connection_, stream_id_);
    Status status = parent_.onStreamClose(this, 0);
    ASSERT(status.ok());
    return;
  }
  if (codec_callbacks_) {
    codec_callbacks_->onCodecLowLevelReset();
  }
  parent_.adapter_->SubmitRst(stream_id_,
                              static_cast<http2::adapter::Http2ErrorCode>(reasonToReset(reason)));
}

Then, second time, it will be called at:

    void onResetEncoded(uint32_t error_code) {
      if (codec_callbacks_ && error_code != 0) {
        codec_callbacks_->onCodecLowLevelReset();
      }
    }

We need a fix for that and may be break change for google.

Activity

  1. added
    triage
    and removed
    triage
    on Nov 26, 2025
  2. wbpcode commented on Nov 26, 2025

    @wbpcode
    MemberAuthor
  3. self-assigned this
    on Nov 26, 2025
  4. wbpcode commented on Nov 26, 2025

    @wbpcode
    MemberAuthor

    Here is an unit have showed the weird behavior:

    TEST_P(Http2CodecImplTest, RefusedStreamReset) {

  5. github-actions commented on Dec 26, 2025

    @github-actions

    This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

  6. added
    stale
    on Dec 26, 2025
  7. github-actions commented on Jan 2, 2026

    @github-actions

    This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/httpbugstale

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions