From 8ac4c6fdd66eeae9468faf523da71acbb708432f Mon Sep 17 00:00:00 2001 From: bkhushboo Date: Thu, 6 Jan 2022 16:34:54 +0530 Subject: [PATCH 1/2] Use byte type lock name which is supported by all tooz drivers --- st2common/st2common/services/executions.py | 2 +- st2common/st2common/services/workflows.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/st2common/st2common/services/executions.py b/st2common/st2common/services/executions.py index 39ce663272..80706e8f79 100644 --- a/st2common/st2common/services/executions.py +++ b/st2common/st2common/services/executions.py @@ -196,7 +196,7 @@ def update_execution(liveaction_db, publish=True, set_result_size=False): """ execution = ActionExecution.get(liveaction__id=str(liveaction_db.id)) - with coordination.get_coordinator().get_lock(str(liveaction_db.id)): + with coordination.get_coordinator().get_lock(str(liveaction_db.id).encode()): # Skip execution object update when action is already in completed state. if execution.status in action_constants.LIVEACTION_COMPLETED_STATES: LOG.debug( diff --git a/st2common/st2common/services/workflows.py b/st2common/st2common/services/workflows.py index 067583f303..b84671f8b1 100644 --- a/st2common/st2common/services/workflows.py +++ b/st2common/st2common/services/workflows.py @@ -938,7 +938,7 @@ def handle_action_execution_completion(ac_ex_db): task_ex_id = ac_ex_db.context["orquesta"]["task_execution_id"] # Acquire lock before write operations. - with coord_svc.get_coordinator(start_heart=True).get_lock(wf_ex_id): + with coord_svc.get_coordinator(start_heart=True).get_lock(str(wf_ex_id).encode()): # Get execution records for logging purposes. wf_ex_db = wf_db_access.WorkflowExecution.get_by_id(wf_ex_id) task_ex_db = wf_db_access.TaskExecution.get_by_id(task_ex_id) From 57c0733316b9dd9b994457696b08920cc9409740 Mon Sep 17 00:00:00 2001 From: bkhushboo Date: Thu, 6 Jan 2022 19:17:48 +0530 Subject: [PATCH 2/2] Add changelog --- CHANGELOG.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f3b0d1d470..780d6cd678 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -39,6 +39,10 @@ Fixed * Fix ``st2-self-check`` script reporting falsey success when the nested workflows runs failed. #5487 +* Use byte type lock name which is supported by all tooz drivers. #5529 + + Contributed by @khushboobhatia01 + 3.6.0 - October 29, 2021 ------------------------