summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2008-07-10 22:07:10 +0000
committerJan Lehnardt <jan@apache.org>2008-07-10 22:07:10 +0000
commitae2d68d08a9c97c71e82da9aae808fb49e699695 (patch)
tree9494eb03d5a28421bb6e983ac9ca650e120f0392 /src
parent197a439cc4c6b61fac3db0e8d60ca16411673e0d (diff)
Wait for the OS to flush our newly written data to disk without timing out too quickly.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@675780 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_db.erl6
-rw-r--r--src/couchdb/couch_file.erl2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/couchdb/couch_db.erl b/src/couchdb/couch_db.erl
index e3ab1622..05b584a5 100644
--- a/src/couchdb/couch_db.erl
+++ b/src/couchdb/couch_db.erl
@@ -298,13 +298,13 @@ update_docs(MainPid, Docs, Options) ->
% 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 @@ save_docs(MainPid, Docs, Options) ->
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) ->
diff --git a/src/couchdb/couch_file.erl b/src/couchdb/couch_file.erl
index 26831c8c..9baa1f73 100644
--- a/src/couchdb/couch_file.erl
+++ b/src/couchdb/couch_file.erl
@@ -156,7 +156,7 @@ truncate(Fd, Pos) ->
%%----------------------------------------------------------------------
sync(Fd) ->
- gen_server:call(Fd, sync).
+ gen_server:call(Fd, sync, infinity).
%%----------------------------------------------------------------------
%% Purpose: Close the file. Is performed asynchronously.