Skip to content

Conversation

@masaori335
Copy link
Contributor

This is an experimental support of HTTP/2 Stream Priority feature.

  • Add a option to enable this feature ( disabled in default ).
    proxy.config.http2.stream_priority_enabled
  • Parse priority parameters of HEADERS and PRIORITY frame correctly.
  • Add Http2DependencyTree and tests using lib/ts/PriorityQueue.h.
  • Create a dependency tree when clients send HEADERS frame with priority parameters or PRIORITY frame.
  • Separate Http2ConnectionState::send_data_frame() into Http2ConnectionState::send_a_data_frame()
    and Http2ConnectionState::send_data_frames().
  • Schedule DATA frames using the WFQ algorithm.

@masaori335
Copy link
Contributor Author

This is second patch after the #525 and TS-4295.

@zwoop
Copy link
Contributor

zwoop commented May 12, 2016

This is running on docs.trafficserver right now.

//############
{RECT_CONFIG, "proxy.config.http2.enabled", RECD_INT, "0", RECU_RESTART_TM, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http2.stream_priority_enabled", RECD_INT, "0", RECU_RESTART_TM, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this need TM restart? Shouldn't TS restart be enough? Looking at it, if you agree, then probably should change proxy.config.http2.enabled to be RESTART_TS as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Since stream_priority_enabled uses REC_EstablishStaticConfigBool(), changes will take effect immediately so it should be RECU_DYNAMIC.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with both of them should be RECU_DYNAMIC. ( I just copied proxy.config.http2.enabled :p )

@zwoop zwoop added the HTTP/2 label May 12, 2016

header_block_fragment_offset += HTTP2_PRIORITY_LEN;
header_block_fragment_length -= HTTP2_PRIORITY_LEN;
stream->node = cstate.dependency_tree->add(params.priority.stream_dependency, stream_id, params.priority.weight,
Copy link
Contributor

Choose a reason for hiding this comment

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

What about if the stream is new and we already received a priority frame. It looks like below you are adding the priority in the tree if the stream doesn't exist. My understanding is that we should be using the priority that is in the tree.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. The priority in the tree shouldn't be overwrote in here, if HEADERS frame don't have priority flag.

@zwoop zwoop added this to the 6.2.0 milestone May 15, 2016
@masaori335 masaori335 force-pushed the ts-3535 branch 5 times, most recently from acc9037 to cc99817 Compare May 16, 2016 05:56
@masaori335
Copy link
Contributor Author

}
if (stream->get_state() == HTTP2_STREAM_STATE_CLOSED) {
dependency_tree->deactivate(node, len);
delete_stream(stream);
Copy link
Contributor

@bryancall bryancall May 18, 2016

Choose a reason for hiding this comment

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

Do we really want to schedule the continuation again if the stream is closed? Should there be a return here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO, we need schedule the continuation again. Because it could be possible that another stream in the dependency tree is ready to send.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense. thx.

- Add a option to enable this feature ( disabled in default ).
  `proxy.config.http2.stream_priority_enabled`
- Parse priority parameters of HEADERS and PRIORITY frame correctly.
- Add Http2DependencyTree and tests using `lib/ts/PriorityQueue.h`.
- Create a dependency tree when clients send HEADERS frame with priority parameters or PRIORITY frame.
- Separate `Http2ConnectionState::send_data_frame()` into `Http2ConnectionState::send_a_data_frame()`
  and `Http2ConnectionState::send_data_frames()`.
- Schedule DATA frames using the WFQ algorithm.
@asfgit asfgit closed this in 16172a4 May 19, 2016
PSUdaemon pushed a commit that referenced this pull request May 20, 2016
- Add a option to enable this feature ( disabled in default ).
  `proxy.config.http2.stream_priority_enabled`
- Parse priority parameters of HEADERS and PRIORITY frame correctly.
- Add Http2DependencyTree and tests using `lib/ts/PriorityQueue.h`.
- Create a dependency tree when clients send HEADERS frame with priority parameters or PRIORITY frame.
- Separate `Http2ConnectionState::send_data_frame()` into `Http2ConnectionState::send_a_data_frame()`
  and `Http2ConnectionState::send_data_frames()`.
- Schedule DATA frames using the WFQ algorithm.

This closes #632

(cherry picked from commit 16172a4)
ogoodman pushed a commit to ogoodman/trafficserver that referenced this pull request Aug 20, 2016
- Add a option to enable this feature ( disabled in default ).
  `proxy.config.http2.stream_priority_enabled`
- Parse priority parameters of HEADERS and PRIORITY frame correctly.
- Add Http2DependencyTree and tests using `lib/ts/PriorityQueue.h`.
- Create a dependency tree when clients send HEADERS frame with priority parameters or PRIORITY frame.
- Separate `Http2ConnectionState::send_data_frame()` into `Http2ConnectionState::send_a_data_frame()`
  and `Http2ConnectionState::send_data_frames()`.
- Schedule DATA frames using the WFQ algorithm.

This closes apache#632
@zwoop zwoop removed this from the 6.2.0 milestone May 4, 2017
@zwoop zwoop removed this from the 6.2.0 milestone May 4, 2017
shinrich added a commit to shinrich/trafficserver that referenced this pull request Jan 9, 2018
TS API and hooks to manipulate the ATS specific session cache and ses…
ywkaras pushed a commit to ywkaras/trafficserver that referenced this pull request Jul 7, 2022
masaori335 pushed a commit to masaori335/trafficserver that referenced this pull request Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants