[ https://issues.apache.org/jira/browse/THRIFT-5324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yuxuan Wang resolved THRIFT-5324. --------------------------------- Fix Version/s: 0.14.0 Resolution: Fixed > THttpClient sends previous message or partial message after http error > ---------------------------------------------------------------------- > > Key: THRIFT-5324 > URL: https://issues.apache.org/jira/browse/THRIFT-5324 > Project: Thrift > Issue Type: Bug > Components: Go - Library > Affects Versions: 0.13.0 > Reporter: Ilya Morozov > Priority: Major > Fix For: 0.14.0 > > Time Spent: 3h 10m > Remaining Estimate: 0h > > We noticed that there's an "out of order sequence response" error immediately > after an http error or premature context closure. We are seeing a lot of > these in production. > It seems like THttpClient does not reset it's internal buffer when http > client returns an error, leaving the whole or partially read message in the > buffer. On next call THttpClient sends the remains of previous message > followed by current message, causing the server to execute it and return the > previous seqId hence the "out of order sequence response" errors. > Here's a small test of THttpClient that demonstrates this issue: > [https://github.com/wheely/thrift/blob/c130f2452428540a4eefc4c422c8abc329ec837d/lib/go/thrift/http_client_test.go#L101-L147] > . > First flush fails due to closed context, second flush succeeds but writes > both messages to the server. In current thrift version this test fails with: > {code:java} > http_client_test.go:144: Received unexpected data: write 1write 2{code} > > Please let me know if you need a better example. > -- This message was sent by Atlassian Jira (v8.20.1#820001)