Skip to content
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

Recursively un-cache Resource Owner #5917

Closed
jridgewell opened this issue Oct 31, 2016 · 4 comments · Fixed by #6028
Closed

Recursively un-cache Resource Owner #5917

jridgewell opened this issue Oct 31, 2016 · 4 comments · Fixed by #6028
Assignees

Comments

@jridgewell
Copy link
Contributor

jridgewell commented Oct 31, 2016

A follow up to #5898.

Imagine:

<owner>
  <child>
    <grandchild>

When <grandchild> first check if it's "owned", it will cache the result on its Resource, as does <child>. When we mark <owner> as the owner of <child>, we update <child>'s cache owner (#5898). But, <grandchild> is unaware of this change, because it has cached a now-out-of-date ownership.

We cannot blindly change the ownership of <grandchild> to <owner>, since it may be directly owned by <child>. But, we can just removed the cached value, and let the logic figure out the correct ownership on the next request.

@zhouyx
Copy link
Contributor

zhouyx commented Nov 2, 2016

Are there real cases that we have two layers of ownership? remove cached value and figure out ownership info every time is correct. But If we never have this kind of use cases (two layers of ownership), I feel it can be a waste of resources.

@jridgewell
Copy link
Contributor Author

Neither case is very common (we only have a few owner extensions). I don't think this necessary to optimize yet.

@camelburrito
Copy link
Contributor

From what i understand - elements should call setOwner on other elements they intend to own.

i don`t understand the need for grandchild to be aware of its owner's owner. That should not affect anything right?

What is the initial cached value for the grandchild? shouldn't the child call setOwner on the grandChild?

@jridgewell
Copy link
Contributor Author

Ownership is implicit in Resources, so <grandchild>'s owner is <owner> until <child> decides it wants to own it.

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

Successfully merging a pull request may close this issue.

4 participants