The issue is reproducible with 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 [email protected] <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"},
```
[ Full content available at: https://github.com/apache/couchdb/pull/1596 ]
This message was relayed via gitbox.apache.org for [email protected]