Browse Source

Adding dev-notes for try-catch block in periodic task

Not removing existing try-catch block for sync_bay_status and other
periodic tasks. Rather leaving a note with the pointers and explanation
for developers to add new periodic task.

Change-Id: I2560d3961c19d73ab78a8e9812d69742c6bd2117
Closes-Bug:1496094
changes/76/247776/3
Surojit Pathak 7 years ago
parent
commit
ab5a173e6d
  1. 10
      magnum/service/periodic.py

10
magnum/service/periodic.py

@ -49,6 +49,16 @@ class MagnumPeriodicTasks(periodic_task.PeriodicTasks):
'''Magnum periodic Task class
Any periodic task job need to be added into this class
NOTE(suro-patz):
- oslo_service.periodic_task runs tasks protected within try/catch
block, with default raise_on_error as 'False', in run_periodic_tasks(),
which ensures the process does not die, even if a task encounters an
Exception.
- The periodic tasks here does not necessarily need another
try/catch block. The present try/catch block here helps putting
magnum-periodic-task-specific log/error message.
'''
def __init__(self, conf, binary):

Loading…
Cancel
Save