[
https://issues.apache.org/jira/browse/TS-4413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15280141#comment-15280141
]
John Rushford edited comment on TS-4413 at 5/11/16 1:53 PM:
------------------------------------------------------------
@PSUdaemon you're right, i made the iterators members of ParentResult but, each
running transaction has a unique iterator and there is no chance of a race
while searching the hash table associated with a row in parent.config. When I
refactored this to implement the secondary has ring, i made a mistake by making
the iterator a member of ParentConsistentHash. As it is now, all transactions
searching the hash for that row in parent.config use that single iterator
instance. So now, I'm moving the iterator back to ParentResult where it should
be to prevent unexpected search results and potential segmentation faults. If
you checkout the old code before the refactor, the iterator was part of
ParentResult. This PR puts it back.
Hopefully this can be merged and backported soon
was (Author: jrushford):
@PSUdaemon you're right, i made the iterators members of ParentResult but, each
running transaction has a unique iterator and there is no chance of a race
while searching the hash table associate with a row in parent.config. When I
refactored this to implement the secondary has ring, i made a mistake by making
the iterator a member of ParentConsistentHash. As it is now, all transactions
searching the hash for that row in parent.config use that single iterator
instance. So now, I'm moving the iterator back to ParentResult where it should
be to prevent unexpected search results and potential segmentation faults. If
you checkout the old code before the refactor, the iterator was part of
ParentResult. This PR puts it back.
Hopefully this can be merged and backported soon
> Fix potential consistent hash iterator race.
> --------------------------------------------
>
> Key: TS-4413
> URL: https://issues.apache.org/jira/browse/TS-4413
> Project: Traffic Server
> Issue Type: Bug
> Components: Parent Proxy
> Reporter: John Rushford
> Assignee: John Rushford
> Fix For: 7.0.0
>
>
> There is a potential race with the iterators used in parent consistent hash
> lookups. PR follows.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)