← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2099799] [NEW] `os_ken.topology.switches` cannot be stopped when observing links

 

Public bug reported:

> Actually I have issued that in ryu project in github,
[here](https://github.com/faucetsdn/ryu/issues/197) is the link

## General description

`os_ken.topology.switches` cannot be stopped by pressing `Ctrl+C` once
when enabling `observe-links` option. But twice can stop that.

## How to reproduce

1. Create a virtual python environment, and activate it
2. Install `os-ken` with `pip install os-ken`
3. Execute `osken-manager os_ken.topology.switches --observe-links`
4. Press `Ctrl+C`, and it will stuck there. Press again and it will stop

> Note: bug can happen in some unknown conditions, I do not record them.
Steps above is a stable way to reproduce this bug.

## Excepted output

Press `Ctrl+C` once, and it will stop

## Version

+ python 3.13.2
+ os-ken 3.0.0

## Reasons

After reading `os_ken/topology/switches.py`, it seems that it stucks at
[here](https://opendev.org/openstack/os-
ken/src/commit/72b87748fad93b147f8eb0819df7b2a92accd990/os_ken/topology/switches.py#L949).
Diving into `lldp_loop(self)` function, and you will find that the
`timeout` will be `None` if `self.ports` is empty (or may be other
reasons). Finally, it will execute `self.lldp_wait(timeout=None)`, which
means it will wait forever.

## Solution

When stopping, set `self.lldp_event` somewhere and it will stop. In my
solution, I set it at the end of `link_loop(self)`,
[here](https://paste.openstack.org/show/826901/) are codes, and it can
work.

** Affects: neutron
     Importance: Undecided
         Status: New

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

Title:
  `os_ken.topology.switches` cannot be stopped when observing links

Status in neutron:
  New

Bug description:
  > Actually I have issued that in ryu project in github,
  [here](https://github.com/faucetsdn/ryu/issues/197) is the link

  ## General description

  `os_ken.topology.switches` cannot be stopped by pressing `Ctrl+C` once
  when enabling `observe-links` option. But twice can stop that.

  ## How to reproduce

  1. Create a virtual python environment, and activate it
  2. Install `os-ken` with `pip install os-ken`
  3. Execute `osken-manager os_ken.topology.switches --observe-links`
  4. Press `Ctrl+C`, and it will stuck there. Press again and it will stop

  > Note: bug can happen in some unknown conditions, I do not record
  them. Steps above is a stable way to reproduce this bug.

  ## Excepted output

  Press `Ctrl+C` once, and it will stop

  ## Version

  + python 3.13.2
  + os-ken 3.0.0

  ## Reasons

  After reading `os_ken/topology/switches.py`, it seems that it stucks
  at [here](https://opendev.org/openstack/os-
  ken/src/commit/72b87748fad93b147f8eb0819df7b2a92accd990/os_ken/topology/switches.py#L949).
  Diving into `lldp_loop(self)` function, and you will find that the
  `timeout` will be `None` if `self.ports` is empty (or may be other
  reasons). Finally, it will execute `self.lldp_wait(timeout=None)`,
  which means it will wait forever.

  ## Solution

  When stopping, set `self.lldp_event` somewhere and it will stop. In my
  solution, I set it at the end of `link_loop(self)`,
  [here](https://paste.openstack.org/show/826901/) are codes, and it can
  work.

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