idle_for referenced before assignment

Bug #1983617 reported by Thiago Paiva Brito
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Bruno Costa

Bug Description

Brief Description
-----------------
At the very beginning of the system initialization, when no periodic tasks are registered yet, sysinv is trowing an error due to a "idle_for" variable referenced before assignment.

Probably since the loop on [1] never starts, idle_for doesn't get a value before being returned on [2]

[1] https://github.com/starlingx/config/blob/master/sysinv/sysinv/sysinv/sysinv/openstack/common/periodic_task.py#L157
[2]https://github.com/starlingx/config/blob/master/sysinv/sysinv/sysinv/sysinv/openstack/common/periodic_task.py#L188

Severity
--------
<Minor: System/Feature is usable with minor issue>

Steps to Reproduce
------------------
Just bootstrap a system and take a look at sysinv.log

Expected Behavior
------------------
Sysinv starts witout issues

Actual Behavior
----------------
Sysinv throw error but starts anyway

Reproducibility
---------------
3/8

System Configuration
--------------------
AIO-SX Debian

Branch/Pull Time/Commit
-----------------------
2022-08-03

Last Pass
---------
n/a

Timestamp/Logs
--------------
sysinv 2022-08-04 16:58:42.043 1916 ERROR oslo.service.loopingcall [-] Fixed interval looping call 'sysinv.fpga_agent.manager.FpgaAgentManager.periodic_tasks' failed: UnboundLocalError: local variable 'idle_for' referenced before assignment
2022-08-04 16:58:42.043 1916 ERROR oslo.service.loopingcall Traceback (most recent call last):
2022-08-04 16:58:42.043 1916 ERROR oslo.service.loopingcall File "/usr/lib/python3/dist-packages/oslo_service/loopingcall.py", line 150, in _run_loop
2022-08-04 16:58:42.043 1916 ERROR oslo.service.loopingcall result = func(*self.args, **self.kw)
2022-08-04 16:58:42.043 1916 ERROR oslo.service.loopingcall File "/usr/lib/python3/dist-packages/sysinv/fpga_agent/manager.py", line 505, in periodic_tasks
2022-08-04 16:58:42.043 1916 ERROR oslo.service.loopingcall return self.run_periodic_tasks(context, raise_on_error=raise_on_error)
2022-08-04 16:58:42.043 1916 ERROR oslo.service.loopingcall File "/usr/lib/python3/dist-packages/sysinv/openstack/common/periodic_task.py", line 188, in run_periodic_tasks
2022-08-04 16:58:42.043 1916 ERROR oslo.service.loopingcall return idle_for
2022-08-04 16:58:42.043 1916 ERROR oslo.service.loopingcall UnboundLocalError: local variable 'idle_for' referenced before assignment
2022-08-04 16:58:42.043 1916 ERROR oslo.service.loopingcall

Test Activity
-------------
Developer Testing

Workaround
----------
Not needed, system starts anyway

Changed in starlingx:
assignee: nobody → Thiago Paiva Brito (outbrito)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to config (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/config/+/852214

Changed in starlingx:
status: New → In Progress
Revision history for this message
Thiago Paiva Brito (outbrito) wrote :
Changed in starlingx:
status: In Progress → Fix Committed
assignee: Thiago Paiva Brito (outbrito) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on config (master)

Change abandoned by "Thiago Paiva Brito <email address hidden>" on branch: master
Review: https://review.opendev.org/c/starlingx/config/+/852214
Reason: Abandoned in favor of https://review.opendev.org/c/starlingx/config/+/851468

Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Medium
status: Fix Committed → Fix Released
tags: added: stx.8.0 stx.config
Changed in starlingx:
assignee: nobody → Bruno Costa (bdacosta)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.