couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [6/8] git commit: Fix race condition in the auth db creation
Date Wed, 25 Apr 2012 22:18:25 GMT
Fix race condition in the auth db creation

This test deletes a database and then tries to go and write to it
without ensuring that it exists. This is just a race with the auth cache
code trying to recreate its own database. This addition just makes sure
it exists by trying to create it and ignoring any 412 errors if the auth
cache won the race.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/ba6c5745
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/ba6c5745
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/ba6c5745

Branch: refs/heads/master
Commit: ba6c5745adc67b3f24837aa6d34250205d2e18e4
Parents: 3beac4e
Author: Paul Joseph Davis <davisp@apache.org>
Authored: Sun Mar 25 05:46:15 2012 -0500
Committer: Paul Joseph Davis <davisp@apache.org>
Committed: Wed Apr 25 16:54:08 2012 -0500

----------------------------------------------------------------------
 share/www/script/test/reader_acl.js |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ba6c5745/share/www/script/test/reader_acl.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/reader_acl.js b/share/www/script/test/reader_acl.js
index e0dde2c..ff770c7 100644
--- a/share/www/script/test/reader_acl.js
+++ b/share/www/script/test/reader_acl.js
@@ -18,6 +18,13 @@ couchTests.reader_acl = function(debug) {
   function testFun() {
     try {
       usersDb.deleteDb();
+      try {
+        usersDb.createDb();
+      } catch(e) {
+        if(usersDb.last_req.status != 412) {
+         throw e;
+        }
+      }
       secretDb.deleteDb();
       secretDb.createDb();
 


Mime
View raw message