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

aonishuk pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 64ae9e8  AMBARI-23323. Locking configure to single process causes 
deadlock (aonishuk)
64ae9e8 is described below

commit 64ae9e854b38c43d4442e5bef827c5fca814e334
Author: Andrew Onishuk <[email protected]>
AuthorDate: Thu Mar 22 14:44:15 2018 +0200

    AMBARI-23323. Locking configure to single process causes deadlock (aonishuk)
---
 .../resource_management/libraries/script/script.py | 23 ----------------------
 1 file changed, 23 deletions(-)

diff --git 
a/ambari-common/src/main/python/resource_management/libraries/script/script.py 
b/ambari-common/src/main/python/resource_management/libraries/script/script.py
index b8aade9..57f165f 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/script/script.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/script/script.py
@@ -104,30 +104,7 @@ def get_path_from_configuration(name, configuration):
 def get_config_lock_file():
   return os.path.join(Script.get_tmp_dir(), "link_configs_lock_file")
 
-class LockedConfigureMeta(type):
-  '''
-  This metaclass ensures that Script.configure() is invoked with a fcntl-based 
process lock
-  if necessary (when Ambari Agent is configured to execute tasks concurrently) 
for all subclasses.
-  '''
-  def __new__(meta, classname, supers, classdict):
-    if 'configure' in classdict:
-      original_configure = classdict['configure']
-
-      def locking_configure(obj, *args, **kw):
-        # local import to avoid circular dependency (default imports Script)
-        from resource_management.libraries.functions.default import default
-        parallel_execution_enabled = 
int(default("/agentLevelParams/agentConfigParams/agent/parallel_execution", 0)) 
== 1
-        lock = FcntlBasedProcessLock(get_config_lock_file(), 
skip_fcntl_failures = True, enabled = parallel_execution_enabled)
-        with lock:
-          original_configure(obj, *args, **kw)
-
-      classdict['configure'] = locking_configure
-
-    return type.__new__(meta, classname, supers, classdict)
-
 class Script(object):
-  __metaclass__ = LockedConfigureMeta
-
   instance = None
 
   """

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to