Skip to content

9.2.x: http2: Track scheduled events#13377

Open
bneradt wants to merge 1 commit into
apache:9.2.xfrom
bneradt:backport-11262-9.2.x
Open

9.2.x: http2: Track scheduled events#13377
bneradt wants to merge 1 commit into
apache:9.2.xfrom
bneradt:backport-11262-9.2.x

Conversation

@bneradt

@bneradt bneradt commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

This is a backport of #11262 because it fixes some rare crashes seen without
it.


Possible fix of #11260. Scheduled events should be tracked and canceled by destructor. Otherwise, scheduled events will be fired to the freed continuation.

@bneradt bneradt requested a review from masaori335 as a code owner July 13, 2026 20:39
Copilot AI review requested due to automatic review settings July 13, 2026 20:39
@bneradt bneradt added this to the 9.2.14 milestone Jul 13, 2026
@bneradt bneradt added HTTP/2 Backport Marked for backport for an LTS patch release labels Jul 13, 2026
@bneradt bneradt self-assigned this Jul 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Backport to the 9.2.x branch that tracks scheduled HTTP/2 connection “xmit” events so they can be canceled during teardown, preventing rare use-after-free crashes when events fire after the continuation has been freed.

Changes:

  • Add _xmit_events to track HTTP2_SESSION_EVENT_XMIT scheduled Event* instances.
  • Cancel all tracked xmit events during Http2ConnectionState::destroy().
  • Remove xmit events from the tracking container when they fire, and record new schedule_imm_local results.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
proxy/http2/Http2ConnectionState.h Adds _xmit_events member to track scheduled xmit events.
proxy/http2/Http2ConnectionState.cc Pushes scheduled xmit events into _xmit_events, erases on callback, and cancels outstanding xmit events in destroy().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread proxy/http2/Http2ConnectionState.h
* http2: Track scheduled events

* Handle events on state_closed

@masaori335 masaori335 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's pretty different from 10.0.x, but the concept is the same - tracking scheduled events and cancel it on destructor.

@github-project-automation github-project-automation Bot moved this from In progress to Ready to Merge in 9.2.x Branch and Release Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport Marked for backport for an LTS patch release HTTP/2

Projects

Status: Ready to Merge

Development

Successfully merging this pull request may close these issues.

3 participants