Skip to content

Commit b9db899

Browse files
committed
First stages integrating JackrabbitDLM for more advanced lock management.
Changes to be committed: modified: .gitignore modified: Base/LauncherLocker modified: Base/Library/JRRsupport.py
1 parent 7dbaaa7 commit b9db899

5 files changed

Lines changed: 27 additions & 46 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
*.pyc
22
*.log
3-
Base/Library/dbcheck.py
3+
__pycache__

Base/LauncherLocker

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,21 @@
33
# Crontab entry ( without has mark #
44
# @reboot ( /home/JackrabbitRelay2/Base/RelayLauncher & ) > /dev/null 2>&1
55

6+
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
7+
8+
e=`ps xa | egrep -c "JackrabbitDLM$"`
9+
if [[ $e -gt 0 ]] ; then
10+
echo JackrabbitDLM loaded
11+
exit 0
12+
fi
13+
614
BaseDir="/home/JackrabbitRelay2/Base"
715

816
cd $BaseDir
917

1018
while true ; do
1119
$BaseDir/JackrabbitLocker
12-
sleep 180
20+
sleep 60
1321
done
1422

1523

Base/Library/JRRsupport.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
import socket
1717
import json
1818

19+
JRDLM=False
20+
if os.path.exists('/home/JackrabbitDLM/DLMLocker.py'):
21+
sys.path.append('/home/JackrabbitDLM')
22+
import DLMLocker as DLM
23+
print("Using JackrabbitDLM")
24+
JRDLM=True
25+
1926
# Get the starting nice value to measure and control OS load.
2027

2128
MasterNice=os.getpriority(os.PRIO_PROCESS,0)
@@ -380,6 +387,16 @@ def Put(self,expire,data):
380387
def Erase(self):
381388
return self.RetryData("Erase",0,None)
382389

390+
# If the newer DLM is available, override the local Locker class.
391+
if JRDLM:
392+
class NewLocker(DLM.Locker):
393+
def __init__(self, filename, Retry=7, Timeout=300, Log=None, ID=None, **kwargs):
394+
# Map the old internal signature to the new DLM signature
395+
# Note: We ignore 'Log' as the new DLM handles its own output/stats
396+
super().__init__(filename, Retry=Retry, Timeout=Timeout, ID=ID, **kwargs)
397+
398+
Locker = NewLocker
399+
383400
###
384401
### General purpose functions
385402
###

Extras/CodeProofs/timedList.test

Lines changed: 0 additions & 1 deletion
This file was deleted.

Extras/CodeProofs/timedList.test.md

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)