Skip to content

Fix HTTP/2 stream (transaction) inactivity timeout#13130

Open
masaori335 wants to merge 1 commit intoapache:masterfrom
masaori335:asf-master-http2-inactivity-timeout
Open

Fix HTTP/2 stream (transaction) inactivity timeout#13130
masaori335 wants to merge 1 commit intoapache:masterfrom
masaori335:asf-master-http2-inactivity-timeout

Conversation

@masaori335
Copy link
Copy Markdown
Contributor

Prior to the change, the activity of the Http2Stream was updated even if send_a_data_frame is failed by error like NO_WINDOW which breaks inactivity timeout.

It looks like when a write is success, the activity is updated by Http2Stream::signal_write_event, so Http2Stream::send_body don't need to update it.

_timeout.update_inactivity();

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes HTTP/2 stream inactivity timeout behavior by avoiding “activity” updates when DATA frame transmission fails due to flow-control conditions (e.g., NO_WINDOW), which previously could prevent transaction_no_activity_timeout_in from firing as intended.

Changes:

  • Removes _timeout.update_inactivity() from Http2Stream::send_body() to avoid bumping inactivity on failed send attempts.

Comment on lines 975 to 979
Http2Stream::send_body(bool /* call_update ATS_UNUSED */)
{
Http2ConnectionState &connection_state = this->get_connection_state();
_timeout.update_inactivity();

reentrancy_count++;
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

This change alters how HTTP/2 stream inactivity is tracked under flow-control / write-blocked conditions (e.g., NO_WINDOW). I couldn't find existing gold tests that exercise the NO_WINDOW path (no references in tests/), so it would be good to add a regression test that stalls an HTTP/2 stream via flow control and asserts transaction_no_activity_timeout_in fires (and also that real outbound DATA resets the timer).

Copilot uses AI. Check for mistakes.
Comment on lines 975 to 979
Http2Stream::send_body(bool /* call_update ATS_UNUSED */)
{
Http2ConnectionState &connection_state = this->get_connection_state();
_timeout.update_inactivity();

reentrancy_count++;
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

Removing _timeout.update_inactivity() here means the stream may no longer bump its inactivity timer after successful DATA frame sends in cases where no signal_write_event() is emitted (e.g., Http2ConnectionState::send_data_frames() can send one or more DATA frames, then stop on NO_WINDOW while more_data is still true, and it does not call signal_write_event() in that path). That can lead to premature transaction_no_activity_timeout_in even though bytes were just sent. Consider updating inactivity only when a frame is actually enqueued/sent (e.g., alongside update_sent_count() / after xmit()), rather than at the start of send_body() or on every send attempt.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants