diff options
author | Randall Leeds <randall@apache.org> | 2012-03-18 20:49:19 -0700 |
---|---|---|
committer | Randall Leeds <randall@apache.org> | 2012-03-18 21:36:48 -0700 |
commit | a38f59d1752ec611f0edc26e8f641a36b52f0c67 (patch) | |
tree | cb2e24c1262bc4ad79eb9324f6795fd23c905ab8 | |
parent | 04c4a1041de06e8e39983cf9616c8baf9d889106 (diff) | |
download | couchdb-a38f59d1752ec611f0edc26e8f641a36b52f0c67.tar.gz |
clear ETS table entry if view group fails to start
Without this, the next process which tries to open the view group
will add itself to the wait list even though the monitor has already
fired. When that happens, the caller hangs forever.
-rw-r--r-- | src/couchdb/couch_view.erl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/couchdb/couch_view.erl b/src/couchdb/couch_view.erl index 29026edd1..f12524d31 100644 --- a/src/couchdb/couch_view.erl +++ b/src/couchdb/couch_view.erl @@ -384,7 +384,9 @@ handle_info({'DOWN', _, _, _, {DbName, DDocId, Sig, Reply}}, Server) -> case Reply of {ok, NewPid} -> link(NewPid), add_to_ets(NewPid, DbName, DDocId, Sig); - _ -> ok end, + _ -> + ets:delete(group_servers_by_sig, {DbName, Sig}) + end, {noreply, Server}. add_to_ets(Pid, DbName, DDocId, Sig) -> |