New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assertion in state_read_server_response_header (v7.1.0) #1531
Comments
The server_entry->read_vio is NULL. From what I can tell this value only gets set due to do_io_read() calls in attach_server_session() and setup_server_read_response_header(). Presumably one of these do_io_read operations failed. Looking at the stack, we had a failure which is getting trigger via the write path (errno 32 broken pipe). I'm guessing that we should have started handling the failure where the do_io_read failed presumably in setup_server_read_response_header(). |
Hmmm, I see
So, as far as I can tell, "data" is set to the write_vio, but the assert checks against the read_vio. |
Oh, nevermind. I saw vio = NULL in the stack, but that is the local variable. That makes sense that the event would be passing up the write vio. It is a write event we are processing. But it looks like the handler is only expecting a read event. I guess a broken pipe shows up as a write event. |
I think, it #never calls handler with read.enabled = 0(or write.enabled). It means the handler don not want this type of event .It may never handle this event and just assert! |
before #947, the EPOLLERR event only set write.triggered to 1, iocore callback SM only if write.enabled==1 and write.triggered==1. |
@zwoop @shinrich It could run into state_read_server_response_header twice if the data is point to write.vio and the handler function doest not do_io_close on vc while the 1st run into it. after #947 , iocore set read.error and write.error to 1 if EPOLLERR that means for that VC iocore will callback read._cont with EVENT_ERROR first and then callback write._cont with EVENT_ERROR if the VC is not disabled or closed in the first callback. I think the SM can not receive EVENT_ERROR twice just like it can not receive EVENT_TIMEOUT twice (UnixNetVConnection::mainEvent will ignore the write VIO callback if its _cont is the same as read VIO). |
I created a PR #1559 to resolve this issue. |
I got this again on Docs.
|
There are 2 reasons for this crash: In my opinion, the EPOLLERR always with read.enabled or write.enabled(otherwise, there is no sm could handle this event, we just ignore). So when EPOLLERR happens, we could push the vc into read_ready_list if the read.enabled == 1, otherwise push it into write_ready_list. By the way, there is my program to re-product this crash:
|
This reverts PRs apache#1559, apache#1522 and apache#947 PR apache#947 made the HTTP state machine unstable and lead to crashes in production like apache#1930 apache#1559 apache#1522 apache#1531 apache#1629 This reverts commit c1ac5f8.
This has been fixed / reverted. |
Seeing this on docs (infrequently):
The text was updated successfully, but these errors were encountered: