Skip to content

Clear vio so lingering IO is not confused when error message is returned - #3268

Merged
shinrich merged 1 commit into
apache:masterfrom
shinrich:issue-3239
Mar 14, 2018
Merged

shinrich merged 1 commit into
apache:masterfrom
shinrich:issue-3239

Conversation

@shinrich

Copy link
Copy Markdown
Member

Addresses issue #3239

When a user agent timeout occurs, ATS sets up a tunnel to send a 408 response to the client. The original post body tunnel is cleared but the read_vio on the client remains. If the client awaken the read ready request gets delivered to the consumer_handler which is expecting only write operations.

If we clear the read_vio before setting up the error tunnel, any additional read operations from the timed out client will be ignored.

@shinrich shinrich added this to the 8.0.0 milestone Mar 12, 2018
@shinrich shinrich self-assigned this Mar 12, 2018
@SolidWallOfCode

Copy link
Copy Markdown
Member

Yes, clearly if the producer is going to be marked dead (not alive) then it shouldn't have any outstanding read operation. Because it's dead!

@scw00

scw00 commented Mar 13, 2018

Copy link
Copy Markdown
Member

I'm not sure why we need this line. If producer timeout occur , we will shutdown read and send 408 response , So read side should not be triggered again.

see https://github.com/apache/trafficserver/blob/7.1.x/proxy/http/HttpSM.cc#L3531

@shinrich

Copy link
Copy Markdown
Member Author

@scw00 that is an interesting point. However, I don't think shutdown will pull the file descriptor out of the epoll object. If the packet already arrived the epoll structure would mark it as read ready possible. Though do_io_shutodown does clear the enable flag. I need to update this fix to make another null check. I'll get this deployed a bit more internally. Last night our 7.1.2 build deployed on 20 machines core dumped 8 times with this issue. So there is an issue, but possibly I'm missing the problem path.

@shinrich

Copy link
Copy Markdown
Member Author

I looked at your other PR and see how the mainEvent does look at f.shutdown as well. I'm pulling in your fix too and will do some experiments today. We are seeing the crash frequently enough, we hopefully get a fix tracked down today.

@shinrich

Copy link
Copy Markdown
Member Author

Updated with addition null checks in do_io's for cache. Ran this plus @scw00's PR #3274 and got no crashes on the pod over night. The previous night without this fix got 8 crashes.

@SolidWallOfCode
SolidWallOfCode requested a review from scw00 March 14, 2018 19:48

@SolidWallOfCode SolidWallOfCode left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@shinrich and I discussed this and as noted we think data can arrive in the gap between the location of this fix and the IO shutdown call, as evidenced by the behavior in production.

@shinrich
shinrich merged commit a22f2c7 into apache:master Mar 14, 2018
@zwoop zwoop modified the milestones: 8.0.0, 7.1.3 Mar 14, 2018
@zwoop

zwoop commented Mar 14, 2018

Copy link
Copy Markdown
Contributor

Cherry-picked to 7.1.x

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants