This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 04ca4ec  Remove locks for upgrades in mssql (#17213)
04ca4ec is described below

commit 04ca4ec124020c9970700c573ef52e345667b9fe
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sun Jul 25 23:28:06 2021 +0200

    Remove locks for upgrades in mssql (#17213)
    
    Closes: #17088
---
 airflow/utils/session.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/airflow/utils/session.py b/airflow/utils/session.py
index ce052de..adde747 100644
--- a/airflow/utils/session.py
+++ b/airflow/utils/session.py
@@ -88,9 +88,8 @@ def create_global_lock(session=None, pg_lock_id=1, 
lock_name='init', mysql_lock_
             session.connection().execute(f"select 
GET_LOCK('{lock_name}',{mysql_lock_timeout});")
 
         if dialect.name == 'mssql':
-            session.connection().execute(
-                f"sp_getapplock @Resource = '{lock_name}', @LockMode = 
'Exclusive', @LockOwner = 'Session';"
-            )
+            # TODO: make locking works for MSSQL
+            pass
 
         yield None
     finally:
@@ -104,6 +103,5 @@ def create_global_lock(session=None, pg_lock_id=1, 
lock_name='init', mysql_lock_
             session.connection().execute(f"select 
RELEASE_LOCK('{lock_name}');")
 
         if dialect.name == 'mssql':
-            session.connection().execute(
-                f"sp_releaseapplock @Resource = '{lock_name}', @LockOwner = 
'Session';"
-            )
+            # TODO: make locking works for MSSQL
+            pass

Reply via email to