File tree Expand file tree Collapse file tree 4 files changed +12
-2
lines changed
st2actions/st2actions/scheduler Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -279,6 +279,8 @@ pool_size = 10
279
279
retry_wait_msec = 3000
280
280
# How often (in seconds) to look for zombie execution requests before rescheduling them.
281
281
gc_interval = 10
282
+ # Number of minutes after which a execution schedule will be rescheduled
283
+ execution_scheduling_timeout_threshold_min = 10
282
284
283
285
[schema]
284
286
# Version of JSON schema to use.
Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ def _register_service_opts():
50
50
default = '/etc/st2/logging.scheduler.conf' ,
51
51
help = 'Location of the logging configuration file.'
52
52
),
53
+ cfg .FloatOpt (
54
+ 'execution_scheduling_timeout_threshold_min' , default = 5 ,
55
+ help = 'How long GC to search back in minutes for orphaned scheduled actions' ),
53
56
cfg .IntOpt (
54
57
'pool_size' , default = 10 ,
55
58
help = 'The size of the pool used by the scheduler for scheduling executions.' ),
Original file line number Diff line number Diff line change 50
50
# (< 5 seconds). If an item is still being marked as processing it likely indicates that the
51
51
# scheduler process which was processing that item crashed or similar so we need to mark it as
52
52
# "handling=False" so some other scheduler process can pick it up.
53
- EXECUTION_SCHEDUELING_TIMEOUT_THRESHOLD_MS = (60 * 1000 )
54
53
55
54
# When a policy delayed execution is detected it will be try to be rescheduled by the scheduler
56
55
# again in this amount of milliseconds.
@@ -62,6 +61,9 @@ def __init__(self):
62
61
self .message_type = LiveActionDB
63
62
self ._shutdown = False
64
63
self ._pool = eventlet .GreenPool (size = cfg .CONF .scheduler .pool_size )
64
+ self ._execution_scheduling_timeout_threshold_min = \
65
+ cfg .CONF .scheduler .execution_scheduling_timeout_threshold_min \
66
+ * 60 * 1000
65
67
self ._coordinator = coordination_service .get_coordinator (start_heart = True )
66
68
self ._main_thread = None
67
69
self ._cleanup_thread = None
@@ -100,7 +102,7 @@ def _reset_handling_flag(self):
100
102
query = {
101
103
'scheduled_start_timestamp__lte' : date .append_milliseconds_to_time (
102
104
date .get_datetime_utc_now (),
103
- - EXECUTION_SCHEDUELING_TIMEOUT_THRESHOLD_MS
105
+ - self . _execution_scheduling_timeout_threshold_min
104
106
),
105
107
'handling' : True
106
108
}
Original file line number Diff line number Diff line change @@ -283,6 +283,9 @@ def _register_ssh_runner_opts():
283
283
284
284
def _register_scheduler_opts ():
285
285
scheduler_opts = [
286
+ cfg .FloatOpt (
287
+ 'execution_scheduling_timeout_threshold_min' , default = 5 ,
288
+ help = 'How long GC to search back in minutes for orphaned scheduled actions' ),
286
289
cfg .IntOpt (
287
290
'pool_size' , default = 10 ,
288
291
help = 'The size of the pool used by the scheduler for scheduling executions.' ),
You can’t perform that action at this time.
0 commit comments