← Back to team overview

duplicity-team team mailing list archive

[Merge] lp:~louis-bouchard/duplicity/remove-allow-concurrency into lp:duplicity

 

Louis Bouchard has proposed merging lp:~louis-bouchard/duplicity/remove-allow-concurrency into lp:duplicity.

Requested reviews:
  duplicity-team (duplicity-team)

For more details, see:
https://code.launchpad.net/~louis-bouchard/duplicity/remove-allow-concurrency/+merge/202504

Remove --allow-concurrency while keeping the locking mechanism intact. Also improved the error message
-- 
https://code.launchpad.net/~louis-bouchard/duplicity/remove-allow-concurrency/+merge/202504
Your team duplicity-team is requested to review the proposed merge of lp:~louis-bouchard/duplicity/remove-allow-concurrency into lp:duplicity.
=== modified file 'bin/duplicity'
--- bin/duplicity	2014-01-17 16:44:46 +0000
+++ bin/duplicity	2014-01-21 16:37:06 +0000
@@ -1316,16 +1316,17 @@
     # determine what action we're performing and process command line
     action = commandline.ProcessCommandLine(sys.argv[1:])
 
-    globals.lockfile = None
-
-    if not globals.allow_concurrency:
-        globals.lockfile = FileLock(os.path.join(globals.archive_dir.name, "lockfile"))
-        if globals.lockfile.is_locked():
-            log.FatalError("Another instance is already running with this archive directory", log.ErrorCode.user_error)
-            log.shutdown()
-            sys.exit(2)
+    globals.lockfile = FileLock(os.path.join(globals.archive_dir.name, "lockfile"))
+    if globals.lockfile.is_locked():
+        log.FatalError("Another instance is already running with this archive directory\n"
+	               "If you are sure that this is the  only instance running you may delete\n"
+		       "the following lockfile and run the command again :\n"
+		       "\t%s" % os.path.join(globals.archive_dir.name, "lockfile.lock" )
+		       , log.ErrorCode.user_error)
+        log.shutdown()
+        sys.exit(2)
             
-        globals.lockfile.acquire(timeout = 0)
+    globals.lockfile.acquire(timeout = 0)
 
     try:
         do_backup(action)

=== modified file 'bin/duplicity.1'
--- bin/duplicity.1	2014-01-20 10:09:18 +0000
+++ bin/duplicity.1	2014-01-21 16:37:06 +0000
@@ -339,15 +339,6 @@
 .SH OPTIONS
 
 .TP
-.BI --allow-concurrency
-Allow duplicity to run more than one instance in the same user context.
-Upon startup, duplicity puts a lock file into the cache directory which
-prevents a second instance of duplicity to run at the same time.
-Using this option will override the locking mechanism and allow for a 
-second duplicity instance to run. This may become useful when a stale
-lockfile has been left behind.
-
-.TP
 .BI --allow-source-mismatch
 Do not abort on attempts to use the same archive dir or remote backend
 to back up different directories. duplicity will tell you if you need

=== modified file 'duplicity/commandline.py'
--- duplicity/commandline.py	2014-01-17 16:44:46 +0000
+++ duplicity/commandline.py	2014-01-21 16:37:06 +0000
@@ -246,10 +246,6 @@
 
     parser = OPHelpFix(option_class = DupOption, usage = usage())
 
-    # If set, more than one instance may run with the given cache dir at the same time
-    parser.add_option("--allow-concurrency", action="store_true")
-
-
     # If this is true, only warn and don't raise fatal error when backup
     # source directory doesn't match previous backup source directory.
     parser.add_option("--allow-source-mismatch", action = "store_true")

=== modified file 'duplicity/globals.py'
--- duplicity/globals.py	2014-01-17 16:44:46 +0000
+++ duplicity/globals.py	2014-01-21 16:37:06 +0000
@@ -95,9 +95,6 @@
 # windows machines.
 time_separator = ":"
 
-# Allow only one concurrent instance runnning with the same cache directory
-allow_concurrency = False
-
 # Global lockfile used to manage concurrency
 lockfile = None
 
@@ -256,9 +253,6 @@
 # Renames (--rename)
 rename = {}
 
-# Allow only one concurrent instance runnning with the same cache directory
-allow_concurrency = False
-
 # enable data comparison on verify runs
 compare_data = False
 


Follow ups