Repository navigation
Fix crash when following redirect - #6589
Merged
Merged
Conversation
Contributor
Author
Contributor
|
@YuanYingdong Can you run |
Contributor
Author
Sure |
Member
|
Looks reasonable, Please run PS: I often used follow directions to squash my commits |
scw00
reviewed
Apr 7, 2020
| s->cache_info.action = CACHE_PREPARE_TO_WRITE; | ||
| } else if (s->cache_info.write_lock_state == CACHE_WL_SUCCESS) { | ||
| s->cache_info.action = CACHE_DO_WRITE; | ||
| } |
Member
There was a problem hiding this comment.
Should we reinit s->cache_info.write_lock_state ?
scw00
reviewed
Apr 12, 2020
When doing redirect and get cache read miss, we need to get cache write lock first other than directly do cache write directly.
vyyd
commented
Apr 13, 2020
vyyd
left a comment
Contributor
Author
There was a problem hiding this comment.
Please squash your changes
Done.
| s->cache_info.action = CACHE_PREPARE_TO_WRITE; | ||
| } else if (s->cache_info.write_lock_state == CACHE_WL_SUCCESS) { | ||
| s->cache_info.action = CACHE_DO_WRITE; | ||
| } |
scw00
approved these changes
Apr 13, 2020
Member
|
[approve ci] |
Contributor
|
Please make sure to mark both Milestones as well as Project (for back ports, when appropriate) on all Issues. |
Contributor
|
Cherry-picked to v9.0.x branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I got ats crashed in the step below:
proxy.config.http.number_of_redirections INT 3,proxy.config.http.redirect.actions STRING default:follow.http://ip/path(no domain in it), and ats get cache read miss for the url os returned.Here is the call stack
history
I think is the reason is in
HttpTransact::OSDNSLookuptrafficserver/proxy/http/HttpTransact.cc
Lines 1960 to 1965 in 134fb60
And
HttpTransact::DecideCacheLookuptrafficserver/proxy/http/HttpTransact.cc
Lines 2091 to 2097 in 134fb60
which decide directly dong cache write without geting cache write lock that caused the crash.
Squash for pr #6561