Skip to content

Commit

Permalink
Get rid of unused periodic_task
Browse files Browse the repository at this point in the history
Currently Barbican is not using the periodic_task framework implemented
in oslo_service but implements its own mechanism based on the lower-
level thread group.

Change-Id: Idc69d61e07826923f3227aad6249252c3f739362
kajinamit committed Dec 15, 2023
1 parent 6acb4f8 commit 73de2e8
Showing 3 changed files with 3 additions and 12 deletions.
4 changes: 0 additions & 4 deletions barbican/common/config.py
Original file line number Diff line number Diff line change
@@ -24,7 +24,6 @@
from oslo_log import log
from oslo_middleware import cors
from oslo_policy import opts as policy_opts
from oslo_service import _options

from barbican import i18n as u
import barbican.version
@@ -256,7 +255,6 @@ def list_opts():
yield None, common_opts
yield None, host_opts
yield None, db_opts
yield None, _options.eventlet_backdoor_opts
yield db_opt_group, core_db_opts
yield retry_opt_group, retry_opts
yield queue_opt_group, queue_opts
@@ -294,8 +292,6 @@ def new_config():
conf.register_opts(common_opts)
conf.register_opts(host_opts)
conf.register_opts(db_opts)
conf.register_opts(_options.eventlet_backdoor_opts)
conf.register_opts(_options.periodic_opts)

conf.register_group(db_opt_group)
conf.register_opts(core_db_opts, group=db_opt_group)
10 changes: 3 additions & 7 deletions barbican/queue/retry_scheduler.py
Original file line number Diff line number Diff line change
@@ -19,7 +19,6 @@
import datetime
import random

from oslo_service import periodic_task
from oslo_service import service

from barbican.common import config
@@ -46,11 +45,9 @@ def _compute_next_periodic_interval():
class PeriodicServer(service.Service):
"""Server to process retry and scheduled tasks.
This server is an Oslo periodic-task service (see
https://docs.openstack.org/oslo.service/latest/reference/periodic_task.html).
On a periodic basis, this server checks for tasks that need to be
retried, and then sends them up to the RPC queue for later
processing by a worker node.
This server is an Oslo service. This server runs a thread to periodically
check tasks that need to be retried, and then sends them up to the RPC
queue for later processing by a worker node.
"""
def __init__(self, queue_resource=None):
super(PeriodicServer, self).__init__()
@@ -80,7 +77,6 @@ def stop(self, graceful=True):
LOG.info("Halting the PeriodicServer")
super(PeriodicServer, self).stop(graceful=graceful)

@periodic_task.periodic_task
def _check_retry_tasks(self):
"""Periodically check to see if tasks need to be scheduled.
1 change: 0 additions & 1 deletion etc/oslo-config-generator/barbican.conf
Original file line number Diff line number Diff line change
@@ -18,6 +18,5 @@ namespace = oslo.middleware.cors
namespace = oslo.middleware.healthcheck
namespace = oslo.middleware.http_proxy_to_wsgi
namespace = oslo.policy
namespace = oslo.service.periodic_task
namespace = oslo.service.service
namespace = oslo.versionedobjects

0 comments on commit 73de2e8

Please sign in to comment.