Explorar el Código

Merge pull request #6674 from jakesmith/hpcc-12618

HPCC-12618 Issue existing locks in exception

Reviewed-By: Gavin Halliday <gavin.halliday@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman hace 10 años
padre
commit
7315be0888
Se han modificado 1 ficheros con 22 adiciones y 1 borrados
  1. 22 1
      dali/base/dasds.cpp

+ 22 - 1
dali/base/dasds.cpp

@@ -7560,7 +7560,28 @@ void CCovenSDSManager::createConnection(SessionId sessionId, unsigned mode, unsi
                                     if (timeout)
                                     {
                                         if (tm.timedout(&remaining))
-                                            throw MakeSDSException(SDSExcpt_LockTimeout, "Failed to establish lock to %s, timeout whilst retrying connection to orphaned connection path", xpath);
+                                        {
+                                            Linked<CLockInfo> lockInfo;
+                                            VStringBuffer timeoutMsg("Failed to establish lock to %s, timeout whilst retrying connection to orphaned connection path", xpath);
+                                            ForEachItemIn(f, freeExistingLocks.existingLockTrees)
+                                            {
+                                                CServerRemoteTree &e = freeExistingLocks.existingLockTrees.item(f);
+                                                {
+                                                    CHECKEDCRITICALBLOCK(lockCrit, fakeCritTimeout);
+                                                    CLockInfo *_lockInfo = queryLockInfo(e.queryServerId());
+                                                    if (_lockInfo)
+                                                    {
+                                                        if (!lockInfo)
+                                                            timeoutMsg.append(", existing lock info: ");
+                                                        timeoutMsg.newline();
+                                                        lockInfo.set(_lockInfo);
+                                                    }
+                                                }
+                                                if (lockInfo)
+                                                    lockInfo->getLockInfo(timeoutMsg);
+                                            }
+                                            throw MakeSDSException(SDSExcpt_LockTimeout, "%s", timeoutMsg.str());
+                                        }
                                     }
                                     else
                                         remaining = 0; // a timeout of 0 means fail immediately if locked