components/openstack/neutron/patches/07-ovs-agent-monitor-assertion-fix.patch
changeset 6848 8e252a37ed0d
parent 6847 57069587975f
child 6849 f9a2279efa0d
equal deleted inserted replaced
6847:57069587975f 6848:8e252a37ed0d
     1 In-house patch to fix an issue where-in we are sending two kill events, from
       
     2 different contexts, to halt green threads and as a result we are tripping over
       
     3 an assert in Neutron OVS agent. It is tracked by
       
     4 
       
     5   https://bugs.launchpad.net/neutron/+bug/1350903 (Ovs agent fails to kill ovsdb
       
     6   monitor properly)
       
     7 
       
     8 and is still open.
       
     9 
       
    10 
       
    11 *** neutron-2015.1.2/neutron/agent/linux/ovsdb_monitor.py	Tue Oct 13 10:35:16 2015
       
    12 --- neutron-2015.1.2/neutron/agent/linux/ovsdb_monitor.py	Wed Mar 23 12:20:07 2016
       
    13 ***************
       
    14 *** 94,101 ****
       
    15                       eventlet.sleep()
       
    16   
       
    17       def _kill(self, *args, **kwargs):
       
    18           self.data_received = False
       
    19 !         super(SimpleInterfaceMonitor, self)._kill(*args, **kwargs)
       
    20   
       
    21       def _read_stdout(self):
       
    22           data = super(SimpleInterfaceMonitor, self)._read_stdout()
       
    23 --- 94,123 ----
       
    24                       eventlet.sleep()
       
    25   
       
    26       def _kill(self, *args, **kwargs):
       
    27 +         """Override async_process method.
       
    28 + 
       
    29 +         Kill the process and the associated watcher greenthreads.
       
    30 +         :param respawning: Optional, whether respawn will be subsequently
       
    31 +                attempted.
       
    32 +         """
       
    33           self.data_received = False
       
    34 ! 
       
    35 !         if not self._kill_event:
       
    36 !             return
       
    37 ! 
       
    38 !         # Halt the greenthreads
       
    39 !         if not self._kill_event.ready():
       
    40 !             self._kill_event.send()
       
    41 ! 
       
    42 !         pid = self.pid
       
    43 !         if pid:
       
    44 !             self._kill_process(pid)
       
    45 ! 
       
    46 !         respawning = kwargs.get('respawning')
       
    47 !         if not respawning:
       
    48 !             # Clear the kill event to ensure the process can be
       
    49 !             # explicitly started again.
       
    50 !             self._kill_event = None
       
    51   
       
    52       def _read_stdout(self):
       
    53           data = super(SimpleInterfaceMonitor, self)._read_stdout()