Fix a bug in lsm_tree:close/1.

There is a race condition based on the monitor set in a call. We might
get a normal exit from the monitor message deep inside gen_server.
This has to be handled. I've seen this race in my QC tests.
This commit is contained in:
Jesper Louis Andersen 2012-01-21 21:17:33 +01:00
parent bb17564d9c
commit baa779ddaa

View file

@ -23,7 +23,9 @@ close(Ref) ->
gen_server:call(Ref, close) gen_server:call(Ref, close)
catch catch
exit:{noproc,_} -> ok; exit:{noproc,_} -> ok;
exit:noproc -> ok exit:noproc -> ok;
%% Handle the case where the monitor triggers
exit:{normal, _} -> ok
end. end.