bneradt commented on code in PR #13447: URL: https://github.com/apache/trafficserver/pull/13447#discussion_r4156629444
########## tests/gold_tests/h2/replay_h2o_pool_reuse/pool_reuse.replay.yaml: ########## @@ -0,0 +1,173 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +meta: + version: '1.0' + +# Five separate H/1 client sessions, each issuing a single request to the +# same origin (matching SNI + IP + cert). This is the production-style +# pattern that exposes the H/2 origin session pooling bug: every new +# client session triggers a fresh `acquire_session` lookup with no +# session attached to the user-agent transaction, so the pool search is +# what determines whether the existing H/2 origin connection is reused. +# If reuse works, all 5 requests should be multiplexed onto a single H/2 +# origin connection (1 connection, 5 streams). + +sessions: + - protocol: + - name: http + version: '1.1' + - name: tcp + - name: ip + version: '4' Review Comment: Added explicit HTTP/2-over-TLS protocol metadata to all five proxy requests and corrected the run description to identify the separate HTTP/1.1 client sessions. The exact one-H2-connection/five-H2-stream assertions remain. Those assertions already prevented an HTTP/1.1 false pass, but the replay now makes its origin protocol explicit. The pool-reuse AuTest passes with the rebuilt binary. ########## src/proxy/http2/Http2Stream.cc: ########## @@ -866,14 +866,25 @@ Http2Stream::update_write_request(bool call_update) this->parsing_header_done = true; Http2StreamDebug("update_write_request parsing done, read %d bytes", bytes_used); - // Schedule session shutdown if response header has "Connection: close" - MIMEField *field = this->_send_header.field_find(static_cast<std::string_view>(MIME_FIELD_CONNECTION)); - if (field) { - auto value{field->value_get()}; - if (value == static_cast<std::string_view>(HTTP_VALUE_CLOSE)) { - SCOPED_MUTEX_LOCK(lock, _proxy_ssn->mutex, this_ethread()); - if (connection_state.get_shutdown_state() == HTTP2_SHUTDOWN_NONE) { - connection_state.set_shutdown_state(HTTP2_SHUTDOWN_NOT_INITIATED, Http2ErrorCode::HTTP2_ERROR_NO_ERROR); + // Only honor `Connection: close` -> graceful-shutdown on the inbound Review Comment: Reduced this to one line explaining why a client request must not drain a shared origin session. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
