You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WRITE_COMPLETE event in http server open causes traffic server to abort #1930
The reason is that the HttpSM::state_send_server_request_header may receive the ERROR event when read side down. Then ats retry another server without cleaning the write side.
@oknet@scw00@zwoop I am okay with having patches for each of the histories that we have on this issue but I am worried that state machine can receive events for past states that too because of something we did in #947 as pointed out by @oknet. As of now, I don't think state machine is robust enough to handle events for past states but if that is expected behavior we should make sure that HttpSM is robust enough to handle that.
@oknet@scw00@zwoop@bryancall@SolidWallOfCode I understand the scenario mentioned in #947 but, state machine now can receive unexpected events. Now, we have to either fix the state machine with the new expectation or revert #947 and come up with a different solution which does not break the expectation and fixes the mentioned scenario. I personally do not think the current approach of leaving the state machine in not so robust state is a good idea.
This might be worthwhile to take to the mailing list (dev@trafficserver). I'm ok either way, but I think it'd be better discussed / decided on the mailing list (I'm not sure who, if any, actually read these Issue comments :-).
Activity
scw00 commentedon May 17, 2017
Print history in HttpSM
vmamidi commentedon May 18, 2017
i dont have any more information
scw00 commentedon May 18, 2017
:(.....sad!!
bryancall commentedon May 23, 2017
@vmamidi What version is this for?
vmamidi commentedon May 23, 2017
we are seeing this on 7.0.0
bryancall commentedon May 24, 2017
@vmamidi Can you post a better backtrace with line numbers in the code? bt full would be great!
vmamidi commentedon Jun 1, 2017
@scw00 I was able to get the history. Here is the history for ATS on 7.1.x branch.
[0] =
fileline = 0x55a3621f7912
*0x55a3621f7912 = string(0x55a3621f7912, [HttpSM.cc:630])
event = 100
reentrancy = 2
[1] =
fileline = 0x55a3621f7d6d
*0x55a3621f7d6d = string(0x55a3621f7d6d, [HttpSM.cc:1339])
event = 60000
reentrancy = 3
[2] =
fileline = 0x55a3621f7d98
*0x55a3621f7d98 = string(0x55a3621f7d98, [HttpSM.cc:1379])
event = 60000
reentrancy = 3
[3] =
fileline = 0x55a3621f7d6d
*0x55a3621f7d6d = string(0x55a3621f7d6d, [HttpSM.cc:1339])
event = 60000
reentrancy = 4
[4] =
fileline = 0x55a3621f7d98
*0x55a3621f7d98 = string(0x55a3621f7d98, [HttpSM.cc:1379])
event = 60000
reentrancy = 4
[5] =
fileline = 0x55a3621f7d6d
*0x55a3621f7d6d = string(0x55a3621f7d6d, [HttpSM.cc:1339])
event = 60000
reentrancy = 5
[6] =
fileline = 0x55a3621f7d98
*0x55a3621f7d98 = string(0x55a3621f7d98, [HttpSM.cc:1379])
event = 60000
reentrancy = 5
[7] =
fileline = 0x55a3621f7d6d
*0x55a3621f7d6d = string(0x55a3621f7d6d, [HttpSM.cc:1339])
event = 60000
reentrancy = 6
[8] =
fileline = 0x55a3621f7d98
*0x55a3621f7d98 = string(0x55a3621f7d98, [HttpSM.cc:1379])
event = 60000
reentrancy = 6
[9] =
fileline = 0x55a3621f7d6d
*0x55a3621f7d6d = string(0x55a3621f7d6d, [HttpSM.cc:1339])
event = 60000
reentrancy = 7
[10] =
fileline = 0x55a3621f7d98
*0x55a3621f7d98 = string(0x55a3621f7d98, [HttpSM.cc:1379])
event = 60000
reentrancy = 7
[11] =
fileline = 0x55a3621fa4bc
*0x55a3621fa4bc = string(0x55a3621fa4bc, [HttpSM.cc:7373])
event = 65535
reentrancy = 7
[12] =
fileline = 0x55a3621f2ebd
*0x55a3621f2ebd = string(0x55a3621f2ebd, [HttpCacheSM.cc:118])
event = 1103
reentrancy = -1
[13] =
fileline = 0x55a3621f84d6
*0x55a3621f84d6 = string(0x55a3621f84d6, [HttpSM.cc:2577])
event = 1103
reentrancy = 8
[14] =
fileline = 0x55a3621f7d6d
*0x55a3621f7d6d = string(0x55a3621f7d6d, [HttpSM.cc:1339])
event = 60000
reentrancy = 9
[15] =
fileline = 0x55a3621f7d98
*0x55a3621f7d98 = string(0x55a3621f7d98, [HttpSM.cc:1379])
event = 60000
reentrancy = 9
[16] =
fileline = 0x55a3621f7d6d
*0x55a3621f7d6d = string(0x55a3621f7d6d, [HttpSM.cc:1339])
event = 60000
reentrancy = 10
[17] =
fileline = 0x55a3621f7d98
*0x55a3621f7d98 = string(0x55a3621f7d98, [HttpSM.cc:1379])
event = 60000
reentrancy = 10
[18] =
fileline = 0x55a3621fa49e
*0x55a3621fa49e = string(0x55a3621fa49e, [HttpSM.cc:7359])
event = 65535
reentrancy = 10
[19] =
fileline = 0x55a3621fa4e9
*0x55a3621fa4e9 = string(0x55a3621fa4e9, [HttpSM.cc:7488])
event = 65535
reentrancy = 10
[20] =
fileline = 0x55a3621f2f73
*0x55a3621f2f73 = string(0x55a3621f2f73, [HttpCacheSM.cc:177])
event = 1108
reentrancy = -1
[21] =
fileline = 0x55a3621f8429
*0x55a3621f8429 = string(0x55a3621f8429, [HttpSM.cc:2458])
event = 1108
reentrancy = 11
[22] =
fileline = 0x55a3621fa4da
*0x55a3621fa4da = string(0x55a3621fa4da, [HttpSM.cc:7386])
event = 65535
reentrancy = 11
[23] =
fileline = 0x55a3621f9263
*0x55a3621f9263 = string(0x55a3621f9263, [HttpSM.cc:4578])
event = 0
reentrancy = 7
[24] =
fileline = 0x55a3621f8055
*0x55a3621f8055 = string(0x55a3621f8055, [HttpSM.cc:1980])
event = 103
reentrancy = 1
[25] =
fileline = 0x55a3621f7fd2
*0x55a3621f7fd2 = string(0x55a3621f7fd2, [HttpSM.cc:1810])
event = 104
reentrancy = 1
[26] =
fileline = 0x55a3621f96cc
*0x55a3621f96cc = string(0x55a3621f96cc, [HttpSM.cc:5485])
event = 104
reentrancy = 1
[27] =
fileline = 0x55a3621fa4da
*0x55a3621fa4da = string(0x55a3621fa4da, [HttpSM.cc:7386])
event = 65535
reentrancy = 1
[28] =
fileline = 0x55a3621f8055
*0x55a3621f8055 = string(0x55a3621f8055, [HttpSM.cc:1980])
event = 103
reentrancy = 1
[29] =
fileline = 0x55a3621f7fd2
*0x55a3621f7fd2 = string(0x55a3621f7fd2, [HttpSM.cc:1810])
event = 104
reentrancy = 1
[30] =
fileline = 0x55a3621f96cc
*0x55a3621f96cc = string(0x55a3621f96cc, [HttpSM.cc:5485])
event = 104
reentrancy = 1
[31] =
fileline = 0x55a3621fa49e
*0x55a3621fa49e = string(0x55a3621fa49e, [HttpSM.cc:7359])
event = 65535
reentrancy = 1
[32] =
fileline = 0x55a3621f7fd2
*0x55a3621f7fd2 = string(0x55a3621f7fd2, [HttpSM.cc:1810])
event = 3
reentrancy = 1
[33] =
fileline = 0x55a3621f96cc
*0x55a3621f96cc = string(0x55a3621f96cc, [HttpSM.cc:5485])
event = 3
reentrancy = 1
[34] =
fileline = 0x55a3621fa4da
*0x55a3621fa4da = string(0x55a3621fa4da, [HttpSM.cc:7386])
event = 65535
reentrancy = 1
[35] =
fileline = 0x55a3621f7ef5
*0x55a3621f7ef5 = string(0x55a3621f7ef5, [HttpSM.cc:1716])
event = 200
reentrancy = 2
[36] =
fileline = 0x55a3621f8055
*0x55a3621f8055 = string(0x55a3621f8055, [HttpSM.cc:1980])
event = 103
reentrancy = 1
[37] =
fileline = 0x55a3621f7ef5
*0x55a3621f7ef5 = string(0x55a3621f7ef5, [HttpSM.cc:1716])
event = 500
reentrancy = 1
scw00 commentedon Jun 1, 2017
great!
scw00 commentedon Jun 1, 2017
Ok I got it.
The reason is that the HttpSM::state_send_server_request_header may receive the ERROR event when read side down. Then ats retry another server without cleaning the write side.
It may reference to #1629 and #1559 .
scw00 commentedon Jun 1, 2017
@oknet
vmamidi commentedon Jun 1, 2017
looks like HttpSM is receiving VC_EVENT_ERROR and also WRITE_COMPLETE event after EOS.
oknet commentedon Jun 1, 2017
ATS do a hostdb lookup to retry the next ip by round robin.
The hostdb callback at [37]
I don't know the reason why [32] shows in the history, it should blocked by pending_action.
Also, I noticed :
The event is changed from 500 to 103. What is that means ?
May be one callback to HttpSM without get the mutex lock first ? HostDB bug ?
oknet commentedon Jun 1, 2017
@scw00 I think we should cleanup server_entry at HttpSM.cc:7359, just do the same thing at HttpSM.cc:7386.
22 remaining items
scw00 commentedon Jun 5, 2017
In the second history, we can see that client post timeout ([27]) and we send the 408 to client. Then server side will receive timeout and retry [28].
The problem is we did not close the vc directly.
That was fixed in 8.0.x
oknet commentedon Jun 5, 2017
@vmamidi please try to fix the 2nd scenario by backport #1583 .
vmamidi commentedon Jun 5, 2017
@oknet @scw00 @zwoop I am okay with having patches for each of the histories that we have on this issue but I am worried that state machine can receive events for past states that too because of something we did in #947 as pointed out by @oknet. As of now, I don't think state machine is robust enough to handle events for past states but if that is expected behavior we should make sure that HttpSM is robust enough to handle that.
vmamidi commentedon Jun 5, 2017
@oknet @scw00 @zwoop @bryancall @SolidWallOfCode I understand the scenario mentioned in #947 but, state machine now can receive unexpected events. Now, we have to either fix the state machine with the new expectation or revert #947 and come up with a different solution which does not break the expectation and fixes the mentioned scenario. I personally do not think the current approach of leaving the state machine in not so robust state is a good idea.
zwoop commentedon Jun 5, 2017
This might be worthwhile to take to the mailing list (dev@trafficserver). I'm ok either way, but I think it'd be better discussed / decided on the mailing list (I'm not sure who, if any, actually read these Issue comments :-).
zwoop commentedon Jun 7, 2017
Everyone: I think we're to the point now of considering backing out #947. Is this agreeable by everyone?
scw00 commentedon Jun 8, 2017
Agree!
oknet commentedon Jun 8, 2017
+1
Revert PR apache#947 - merge to 7.1.x
Revert PR #947 - merge to 7.1.x
zwoop commentedon Jun 23, 2017
I'm removing the 7.1.0 Milestone from this Issue, but keeping this open for now as there's valuable discussions here.
bryancall commentedon May 22, 2019
If this is still an issue please reopen.