Skip to content
Merged
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
11 changes: 1 addition & 10 deletions proxy/http/HttpTunnel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1343,16 +1343,7 @@ HttpTunnel::consumer_handler(int event, HttpTunnelConsumer *c)
c->producer->read_success = true;
// Go ahead and clean up the producer side
if (p->alive) {
p->alive = false;
if (p->read_vio) {
p->bytes_read = p->read_vio->ndone;
} else {
p->bytes_read = 0;
}
if (p->vc != HTTP_TUNNEL_STATIC_PRODUCER) {
// Clear any outstanding reads
p->vc->do_io_read(nullptr, 0, nullptr);
}
producer_handler(VC_EVENT_READ_COMPLETE, p);
Copy link
Contributor

@vmamidi vmamidi Dec 14, 2020

Choose a reason for hiding this comment

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

At this point, we may still have data left to read from the producer, right? How can we send an VC_EVENT_READ_COMPLETE to the producer?

Copy link
Member Author

Choose a reason for hiding this comment

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

If the consumer is write_complete, it doesn't matter if there was more data on the producer, the consumer will never read it. The tunnel will be stuck forever.

Copy link
Contributor

@vmamidi vmamidi Dec 16, 2020

Choose a reason for hiding this comment

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

I agree that the consumer never reads it. However, NetVC/CacheVC may still try to read the outstanding data and signal the continuation that VIO is holding and may result in a crash if that continuation is already cleared.

Copy link
Member Author

Choose a reason for hiding this comment

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

We should not leave around any vio's pointing to the continuation after we have freed the continuation.

Copy link
Member Author

Choose a reason for hiding this comment

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

We have been running this commit in our 9.0.x since the end of 2020 without issue.

}
} else if (c->vc_type == HT_HTTP_SERVER) {
c->producer->handler_state = HTTP_SM_POST_UA_FAIL;
Expand Down