nickva edited a comment on issue #1596: Fix couch server race condition URL: https://github.com/apache/couchdb/pull/1596#issuecomment-419169919 The issue is reproducible with this script (in a remsh): ``` f(FuzzIt), FuzzIt = fun(DbName, Tries, WaitMax) -> Ref = erlang:monitor(process, whereis(couch_server)), [begin [begin CallRefs = [Open1Ref, DeleteRef, Open2Ref] = [make_ref(), make_ref(), make_ref()], whereis(couch_server) ! {'$gen_call', {self(), Open1Ref}, {create, DbName, []}}, timer:sleep(W), whereis(couch_server) ! {'$gen_call', {self(), DeleteRef}, {delete, DbName, []}}, whereis(couch_server) ! {'$gen_call', {self(), Open2Ref}, {open, DbName, []}}, [receive {R, _} -> ok end || R <- CallRefs] end || W <- lists:seq(0, WaitMax)] end || _ <- lists:seq(1, Tries)], receive {'DOWN', Ref, _, _, Reason} -> {bam, Reason} after 5000 -> nope end end. ``` When run like this for example: ``` FuzzIt(<<"blah">>, 100, 15). ``` It might help to have a few dbs open and some activity, like say a bunch of replication jobs running as well. The node would crash and possibly restart leaving something like this in the log: ``` [error] 2018-09-06T17:01:48.085468Z node1@127.0.0.1 <0.243.0> -------- couch_server terminating with {function_clause,[{couch_server,'-handle_call/3-lc$^1/1-1-',[undefined],[{file,"src/couch_server.erl"},{line,434}]},{couch_server,handle_call,3,[{file,"src/couch_server.erl"}, ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services