anchor.diff:      erlang:put(changes_reader, ChangesReader),
       %% Changes manager - responsible for dequeing batches from the changes queue
       %% and deliver them to the worker processes.
  -    ChangesManager = spawn_changes_manager(self(), ChangesQueue, BatchSizeItems),
  +    Self = self(),
  +    ChangesManager = start_via_exit_eater(
  +                       fun () ->
  +                               spawn_changes_manager(Self, ChangesQueue, BatchSizeItems)
  +                       end),
       %% This starts the worker processes. They ask the changes queue manager for a
       %% a batch of _changes rows to process -> check which revs are missing in the
       %% target, and for the missing ones, it copies them from the source to the target.
  
positive.code:         end,
      {ok, Target} = couch_api_wrap:db_open(TgtDB, []),
  
      {ok, ChangesQueue} = couch_work_queue:new([
                                                 {max_items, BatchSizeItems * NumWorkers * 2},
                                                 {max_size, 100 * 1024 * NumWorkers}
                                                ]),
      %% This starts the _changes reader process. It adds the changes from
      %% the source db to the ChangesQueue.
      SupportsDatatype =
  
negative.code:     Workers = lists:map(
                  fun(WorkerID) ->
                          WorkerOption2 = WorkerOption#rep_worker_option{worker_id = WorkerID},
                          start_via_exit_eater(
                            fun () ->
                                    {ok, WorkerPid} = xdc_vbucket_rep_worker:start_link(WorkerOption2),
                                    WorkerPid
                            end)
                  end,
                  lists:seq(1, NumWorkers)),
  
  