couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r675780 - in /incubator/couchdb/trunk/src/couchdb: couch_db.erl couch_file.erl
Date Thu, 10 Jul 2008 22:07:11 GMT
Author: jan
Date: Thu Jul 10 15:07:10 2008
New Revision: 675780

URL: http://svn.apache.org/viewvc?rev=675780&view=rev
Log:
Wait for the OS to flush our newly written data to disk without timing out too quickly.

Modified:
    incubator/couchdb/trunk/src/couchdb/couch_db.erl
    incubator/couchdb/trunk/src/couchdb/couch_file.erl

Modified: incubator/couchdb/trunk/src/couchdb/couch_db.erl
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/src/couchdb/couch_db.erl?rev=675780&r1=675779&r2=675780&view=diff
==============================================================================
--- incubator/couchdb/trunk/src/couchdb/couch_db.erl (original)
+++ incubator/couchdb/trunk/src/couchdb/couch_db.erl Thu Jul 10 15:07:10 2008
@@ -298,13 +298,13 @@
     % flush unwritten binaries to disk.
     DocBuckets3 = [[doc_flush_binaries(Doc, Db#db.fd) || Doc <- Bucket] || Bucket <-
DocBuckets2],
 
-    case gen_server:call(MainPid, {update_docs, DocBuckets3, [new_edits | Options]}) of
+    case gen_server:call(MainPid, {update_docs, DocBuckets3, [new_edits | Options]}, infinity)
of
     ok -> {ok, NewRevs};
     retry ->
         Db2 = get_db(MainPid),
         DocBuckets4 = [[doc_flush_binaries(Doc, Db2#db.fd) || Doc <- Bucket] || Bucket
<- DocBuckets3],
         % We only retry once
-        case gen_server:call(MainPid, {update_docs, DocBuckets4, [new_edits | Options]})
of
+        case gen_server:call(MainPid, {update_docs, DocBuckets4, [new_edits | Options]},
infinity) of
         ok -> {ok, NewRevs};
         Else -> throw(Else)
         end;
@@ -320,7 +320,7 @@
     Db = get_db(MainPid),
     DocBuckets = group_alike_docs(Docs),
     DocBuckets2 = [[doc_flush_binaries(Doc, Db#db.fd) || Doc <- Bucket] || Bucket <-
DocBuckets],
-    ok = gen_server:call(MainPid, {update_docs, DocBuckets2, Options}).
+    ok = gen_server:call(MainPid, {update_docs, DocBuckets2, Options}, infinity).
 
 
 doc_flush_binaries(Doc, Fd) ->

Modified: incubator/couchdb/trunk/src/couchdb/couch_file.erl
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/src/couchdb/couch_file.erl?rev=675780&r1=675779&r2=675780&view=diff
==============================================================================
--- incubator/couchdb/trunk/src/couchdb/couch_file.erl (original)
+++ incubator/couchdb/trunk/src/couchdb/couch_file.erl Thu Jul 10 15:07:10 2008
@@ -156,7 +156,7 @@
 %%----------------------------------------------------------------------
 
 sync(Fd) ->
-    gen_server:call(Fd, sync).
+    gen_server:call(Fd, sync, infinity).
 
 %%----------------------------------------------------------------------
 %% Purpose: Close the file. Is performed asynchronously.



Mime
View raw message