← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1837529] Re: Cannot use push-notification with custom objects

 

Reviewed:  https://review.opendev.org/672261
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=2db02023eec96d825749490d40c750a37b97daec
Submitter: Zuul
Branch:    master

commit 2db02023eec96d825749490d40c750a37b97daec
Author: Roman Dobosz <gryf73@xxxxxxxxx>
Date:   Tue Jul 23 10:45:19 2019 +0000

    Initialize modifiable list of resources in CacheBackedPluginApi.
    
    Currently, if one wanted to add any other resources (including custom
    objects), there is no simple way to achieve that, since list of defined
    resource types is hardcoded in create_cache_for_l2_agent function,
    which is called in __init__ of the CacheBackedPluginApi. Even if we
    derive from it, we must call super() on descendant, otherwise we end up
    with uninitialized PluginApi part. But if we do the super() on it, we
    end up on having hardcoded resources only, and creating a new remote
    resource cache object will make a new set of listeners, while the
    listeners for the old object still exist, and may cause memory leaks.
    RemoteResourceWatcher class have only initializers for those listeners,
    and there is no obvious way to stop/clean them.
    
    In this patch we propose to move create_cache_for_l2_agent function to
    CacheBackedPluginApi class, and make resource list to be class
    attribute, so that it can be easily modified.
    
    Change-Id: Ia65ecaf7b48926b74505226a5922b85e2cb593a6
    Closes-Bug: 1837529


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1837529

Title:
  Cannot use push-notification with custom objects

Status in neutron:
  Fix Released

Bug description:
  We have custom object which we would like to have updated in remote
  resource cache. Currently, in CacheBackedPluginApi resource cache is
  created on initialization by create_cache_for_l2_agent function which
  have fixed list of resources to subscribe.

  If we want to use additional type of resource, there is no other way,
  than either copy entire class and use custom cache creation function,
  or alter the list in the neutron code, which is bad either.

  This isn't a bug, but rather it's an annoying inconvenience, which
  might be easily fixed.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1837529/+subscriptions


References