You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Damien Katz <da...@apache.org> on 2010/07/01 23:20:55 UTC
Re: 1.0 Vote
I think I've fixed the windows file issues and the occasional hang (happens when erlang fails to restart fast enough, it shut's itself down). I switched to launching using werl instead of erl, which fixes the problem. For production use, erl can still be used just fine, _restart isn't supposed to be used in production.
Mark, can you verify it's fixed on your end?
-Damien
On Jun 27, 2010, at 9:38 PM, Juhani Ränkimies wrote:
> On Sun, Jun 27, 2010 at 9:10 AM, Mark Hammond <sk...@gmail.com> wrote:
>> On 27/06/2010 12:01 PM, Damien Katz wrote:
>>>
>>> Mark, looks like it's the file:sync calls. Can you try this patch?
>>>
>>> Index: src/couchdb/couch_file.erl
>>> ===================================================================
>>> --- src/couchdb/couch_file.erl (revision 957790)
>>> +++ src/couchdb/couch_file.erl (working copy)
>>> @@ -148,7 +148,7 @@
>>> %%----------------------------------------------------------------------
>>>
>>> sync(Filepath) when is_list(Filepath) ->
>>> - {ok, Fd} = file:open(Filepath, [read, raw]),
>>> + {ok, Fd} = file:open(Filepath, [write, raw]),
>>> try file:sync(Fd) after file:close(Fd) end;
>>> sync(Fd) ->
>>> gen_server:call(Fd, sync, infinity).
>>
>> I made that patch and it looked good for a while. The 'all_docs' test
>> passes, but the 'basics' test fails with the traceback at
>> http://pastebin.com/6ZZU8B6q. As you will see at the end, couch itself
>> stopped, so no other requests could be made.
>>
>> Attempting to restart couch then failed with a similar traceback at it comes
>> up - http://pastebin.com/4A1QEDq3. My reading of it is that the DB is
>> somehow corrupted (it can't find a valid header). If I stop couch, delete
>> all .couch files from the file-system and restart, it starts up fine again
>> and re-attempting the 'basics' test does exactly the same thing again.
>>
>> Note that all the above was after re-enabling the auth database, but I don't
>> think the problem is related to that specifically.
>>
>> Mark
>>
>
> Opening in append mode in sync/1 helps for 'basics' test. But there is
> still something wrong. The server hangs in different tests when trying
> to 'Run All'.
>
> diff --git a/src/couchdb/couch_file.erl b/src/couchdb/couch_file.erl
> index 8c82272..6671bcc 100644
> --- a/src/couchdb/couch_file.erl
> +++ b/src/couchdb/couch_file.erl
> @@ -148,7 +148,7 @@ truncate(Fd, Pos) ->
> %%----------------------------------------------------------------------
>
> sync(Filepath) when is_list(Filepath) ->
> - {ok, Fd} = file:open(Filepath, [read, raw]),
> + {ok, Fd} = file:open(Filepath, [append, raw]),
> try file:sync(Fd) after file:close(Fd) end;
> sync(Fd) ->
> gen_server:call(Fd, sync, infinity).
>
>
> -juhani