Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions proxy/http/HttpSM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -465,11 +465,8 @@ HttpSM::state_add_to_list(int event, void * /* data ATS_UNUSED */)
if (ua_entry->read_vio) {
// Seems like ua_entry->read_vio->disable(); should work, but that was
// not sufficient to stop the state machine from processing IO events until the
// TXN_START hooks had completed
// Preserve the current read cont and mutex
NetVConnection *netvc = ((ProxyTransaction *)ua_entry->vc)->get_netvc();
ink_assert(netvc != nullptr);
ua_entry->read_vio = ua_entry->vc->do_io_read(netvc->read_vio_cont(), 0, nullptr);
// TXN_START hooks had completed. Just set the number of bytes to read to 0
ua_entry->read_vio = ua_entry->vc->do_io_read(this, 0, nullptr);
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.

I got the same idea while digging another issue.

}
return EVENT_CONT;
}
Expand Down
17 changes: 10 additions & 7 deletions proxy/http2/Http2Stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,16 @@ Http2Stream::send_request(Http2ConnectionState &cstate)
return;
}

if (this->recv_end_stream) {
this->read_vio.nbytes = bufindex;
this->signal_read_event(VC_EVENT_READ_COMPLETE);
} else {
// End of header but not end of stream, must have some body frames coming
this->has_body = true;
this->signal_read_event(VC_EVENT_READ_READY);
// Is the _sm ready to process the header?
if (this->read_vio.nbytes > 0) {
Copy link
Copy Markdown
Contributor

@masaori335 masaori335 May 25, 2021

Choose a reason for hiding this comment

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

When read_vio.nbytes == 0, ATS retry this Http2Stream::send_request() call by somehow?

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.

NVM. Retry on the HTTP/2 side is not required. My understanding is

  • If HttpSM can't get hook continuation lock in above, it schedule EVENT_INTERVAL.
  • When HttpSM handles EVENT_INTERVAL, it'll read request in this read_vio.

if (this->recv_end_stream) {
this->read_vio.nbytes = bufindex;
this->signal_read_event(VC_EVENT_READ_COMPLETE);
} else {
// End of header but not end of stream, must have some body frames coming
this->has_body = true;
this->signal_read_event(VC_EVENT_READ_READY);
}
}
}

Expand Down