Author: fdmanana
Date: Tue Sep 13 00:27:16 2011
New Revision: 1169983
URL: http://svn.apache.org/viewvc?rev=1169983&view=rev
Log:
Notify waiting requests when replication cancelled
When cancelling a non-continuous replication, notify that the
replication was cancelled. This is necessary to unblock other
clients who are waiting for the replication result.
Patch by Dale Harvey. Thanks.
Modified:
couchdb/trunk/src/couchdb/couch_replicator.erl
Modified: couchdb/trunk/src/couchdb/couch_replicator.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_replicator.erl?rev=1169983&r1=1169982&r2=1169983&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_replicator.erl (original)
+++ couchdb/trunk/src/couchdb/couch_replicator.erl Tue Sep 13 00:27:16 2011
@@ -406,8 +406,9 @@ terminate(normal, #rep_state{rep_details
couch_replication_notifier:notify({finished, RepId, CheckpointHistory}),
couch_replication_manager:replication_completed(Rep);
-terminate(shutdown, State) ->
+terminate(shutdown, #rep_state{rep_details = #rep{id = RepId}} = State) ->
% cancelled replication throught ?MODULE:cancel_replication/1
+ couch_replication_notifier:notify({error, RepId, <<"cancelled">>}),
terminate_cleanup(State);
terminate(Reason, State) ->
|