Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-7791

composites - weakref caching

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: butler
    • Labels:
      None

      Description

      when getting objects in butler, keep a weakref to objects so that if they are a component that is loaded a second time by another object the component does not get loaded into a second instance, but is instead shared between composites.

      if feasible, the caching mechanism should be easy to change by configuration or by subclass or plugin.

      notes:
      weakref caching has certain implications; objects will not be kept if another (composite) object is destroyed; if the composite is destroyed and then another composite that uses the same component is loaded, the object will be reloaded. (this has plusses and minuses, depending on use case

      Butler does not protect shared objects being changed and it's possible that one owner could change the shared object at a time or in a way that the other owner does not expect it. The question of how to address this remains open.

        Attachments

          Issue Links

            Activity

            Hide
            npease Nate Pease added a comment -

            added Jim as a reviewer to look at tests and documentation.

            Show
            npease Nate Pease added a comment - added Jim as a reviewer to look at tests and documentation.
            Hide
            npease Nate Pease added a comment -

            Jim Bosch, Kian-Tat Lim: ignore the daf_butlerUtils branch.

            Show
            npease Nate Pease added a comment - Jim Bosch , Kian-Tat Lim : ignore the daf_butlerUtils branch.
            Hide
            npease Nate Pease added a comment -

            you may notice the PR is against tickets/DM-7719 (which is confusing in that this ticket is DM-7791, the numbering similarity was totally unintentional, but I digress). DM-7719 will get merged to master first, then this will get rebased onto master and these changes checked in.

            Show
            npease Nate Pease added a comment - you may notice the PR is against tickets/ DM-7719 (which is confusing in that this ticket is DM-7791 , the numbering similarity was totally unintentional, but I digress). DM-7719 will get merged to master first, then this will get rebased onto master and these changes checked in.
            Hide
            jbosch Jim Bosch added a comment -

            My review is complete. I've left a few comments on the PRs.

            Show
            jbosch Jim Bosch added a comment - My review is complete. I've left a few comments on the PRs.
            Hide
            bvan Brian Van Klaveren added a comment -

            I'm done reviewing this, just a minor comment on potential random hashes.

            Show
            bvan Brian Van Klaveren added a comment - I'm done reviewing this, just a minor comment on potential random hashes.
            Hide
            ktl Kian-Tat Lim added a comment -

            Let's pin down and document the exact semantics desired for mutation of already-loaded objects. (You might avoid the term "cached" since that usually implies identical behavior if the cache is cleared, either via write-through or write-back, neither of which we implement.)

            Show
            ktl Kian-Tat Lim added a comment - Let's pin down and document the exact semantics desired for mutation of already-loaded objects. (You might avoid the term "cached" since that usually implies identical behavior if the cache is cleared, either via write-through or write-back, neither of which we implement.)

              People

              • Assignee:
                npease Nate Pease
                Reporter:
                npease Nate Pease
                Reviewers:
                Brian Van Klaveren, Jim Bosch, Kian-Tat Lim
                Watchers:
                Brian Van Klaveren, Jim Bosch, Kian-Tat Lim, Nate Pease
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel