Skip to content

Don't pool origin connections with unconsumed request body#12926

Open
JakeChampion wants to merge 4 commits intoapache:masterfrom
JakeChampion:jake/100
Open

Don't pool origin connections with unconsumed request body#12926
JakeChampion wants to merge 4 commits intoapache:masterfrom
JakeChampion:jake/100

Conversation

@JakeChampion
Copy link
Contributor

@JakeChampion JakeChampion commented Feb 27, 2026

When an origin responds before consuming a request body sent with Expect: 100-continue, ATS was returning the origin connection to the pool with leftover body data in the TCP stream
The next request reusing that connection would see the leftover bytes as a corrupted response

Fix by recording server_request_body_bytes when aborting the tunnel early, then checking it in both connection pooling paths to prevent reuse when a request body was in flight

When an origin responds before consuming a request body sent with `Expect: 100-continue`, ATS was returning the origin connection to the pool with leftover body data in the TCP stream
The next request reusing that connection would see the leftover bytes as a corrupted response

Fix by recording `server_request_body_bytes` when aborting the tunnel early, then checking it in both connection pooling paths to prevent reuse when a request body was in flight
@JakeChampion JakeChampion changed the title Add tests for 100-continue connection pool corruption scenario Don't pool origin connections with unconsumed request body Feb 27, 2026
@JakeChampion JakeChampion marked this pull request as ready for review February 27, 2026 16:45
@brbzull0 brbzull0 self-requested a review February 27, 2026 18:44
@brbzull0
Copy link
Contributor

I'll have a look at this. @JakeChampion are you on slack?

@JakeChampion
Copy link
Contributor Author

I'll have a look at this. @JakeChampion are you on slack?

I am not, I requested an invite some time last year but I don't think it's been accepted

@brbzull0
Copy link
Contributor

I'll have a look at this. @JakeChampion are you on slack?

I am not, I requested an invite some time last year but I don't think it's been accepted

Ohh, sorry about that. I've just had a look and couldn't find the email. Please send another email to the users@trafficserver.apache.org list and I'll help you with that.

Thanks.

@JakeChampion
Copy link
Contributor Author

I'll have a look at this. @JakeChampion are you on slack?

I am not, I requested an invite some time last year but I don't think it's been accepted

Ohh, sorry about that. I've just had a look and couldn't find the email. Please send another email to the users@trafficserver.apache.org list and I'll help you with that.

Thanks.

Thank you, I've just sent an email

@JakeChampion
Copy link
Contributor Author

I'll have a look at this. @JakeChampion are you on slack?

I am not, I requested an invite some time last year but I don't think it's been accepted

Ohh, sorry about that. I've just had a look and couldn't find the email. Please send another email to the users@trafficserver.apache.org list and I'll help you with that.

Thanks.

Thank you, I've just sent an email

Unfortunately I can not send an email there

Hi. This is the qmail-send program at apache.org.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

users@trafficserver.apache.org:
Must be sent from an @apache.org address or a subscriber address or an address in LDAP

@brbzull0
Copy link
Contributor

apologies. send me an email at dmeden@apache.org. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants