You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/09/10 18:57:48 UTC

[GitHub] [couchdb] tonysun83 commented on a change in pull request #3144: move remonitor code into DOWN message

tonysun83 commented on a change in pull request #3144:
URL: https://github.com/apache/couchdb/pull/3144#discussion_r486567890



##########
File path: src/smoosh/src/smoosh_channel.erl
##########
@@ -275,24 +276,34 @@ start_compact(State, Db) ->
     case smoosh_utils:ignore_db(Db) of
     false ->
         DbPid = couch_db:get_pid(Db),
-        Key = couch_db:name(Db),
-        case couch_db:get_compactor_pid(Db) of
-            nil ->
-                Ref = erlang:monitor(process, DbPid),
-                DbPid ! {'$gen_call', {self(), Ref}, start_compact},
-                State#state{starting=[{Ref, Key}|State#state.starting]};
-            % database is still compacting so we can just monitor the existing
-            % compaction pid
-            CPid ->
-                couch_log:notice("Db ~s continuing compaction",
-                    [smoosh_utils:stringify(Key)]),
-                erlang:monitor(process, CPid),
-                State#state{active=[{Key, CPid}|State#state.active]}
-        end;
+        Ref = erlang:monitor(process, DbPid),
+        DbPid ! {'$gen_call', {self(), Ref}, start_compact},
+        State#state{starting=[{Ref, couch_db:name(Db)}|State#state.starting]};

Review comment:
       there isn't a comment here. are you talking about line 295 :
   
   ```
   couch_log:notice("Db ~s continuing compaction",
                   [smoosh_utils:stringify(DbName)])
   ```
   to
   
   ```
   couch_log:notice("Compaction is already running for ~p, so monitor existing compaction pid ~p",
                   [smoosh_utils:stringify(DbName), CPID])
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org