Przeglądaj źródła

HPCC-25256 Prevent foreign subfile locking

When deleting a superfile it clears the SuperOwner meta data
from it's subfiles.
If some of those subfiles are foreign subfiles, it spuriously
attemps to create lock paths to the local env. file of the same
name (locking is not supported on foreign files).
As a consequence, it may block or be blocked, if the local named
file is locked or trying to lock.

Or, even worse (and how the bug was seen), if the subfile has
the same name as the parent, it will deadlock, as the parent is
already locked.

Signed-off-by: Jake Smith <jake.smith@lexisnexisrisk.com>
Jake Smith 4 lat temu
rodzic
commit
e15b34d4b8
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2 0
      dali/base/dadfs.cpp

+ 2 - 0
dali/base/dadfs.cpp

@@ -5059,6 +5059,8 @@ protected:
             {
                 CDfsLogicalFileName subfn;
                 subfn.set(name);
+                if (subfn.isForeign() || subfn.isExternal())
+                    continue; // can't be owned by a super in this environment, no locking
                 CFileLock fconnlockSub;
                 // JCSMORE - this is really not right, but consistent with previous version
                 // MORE: Use CDistributedSuperFile::linkSuperOwner(false) - ie. unlink