anchor.diff:  on({'DOWN', Ref, process, Pid, _Reason}, State) ->
       ?TRACE("proto_sched:on({'DOWN', ~p, process, ~p, ~p}).",
              [Ref, Pid, _Reason]),
  -    % TODO: should we also enqueue a send_error message if a shepherd
  -    %       was used but we do not have a send_error in our message queue?
  -    % -> for now rely on a send_error which should be there for local
  -    %    messages (recall that monitors are only set up for local pids)
  -    %    and do not create the on_handler_done by ourself!
  -    State;
  -%%     %% search for trace with status delivered, Pid and Ref
  -%%     StateTail = lists:dropwhile(fun({_TraceId, X}) ->
  -%%                                         case X#state.status of
  -%%                                             {delivered, _Pid, Ref, _Time, _OldSendOptions} ->
  -%%                                                 false;
  -%%                                             _ -> true
  -%%                                         end end,
  -%%                                 State),
  -%%     case StateTail of
  -%%         [] -> State; %% outdated 'DOWN' message - ok
  -%%         [_TraceEntry | _] ->
  -%%             %% log:log("proto_sched:on({'DOWN', ~p, process, ~p, ~p}).",
  -%%             %%         [Ref, Pid, Reason]),
  -%%             %% the process we delivered to has died, so we generate a
  -%%             %% gc_on_done message ourselves.
  -%%             %% use post_op to avoid concurrency with send_error
  -%%             %% message when delivering to already dead nodes.
  -%%             gen_component:post_op({on_handler_done,
  -%%                                    element(1, TraceEntry),
  -%%                                    pid_ended_died_or_killed,
  -%%                                    comm:make_global(Pid)}, State)
  -%%     end;
  +    %% NOTE: do not create a send_error message since the message may have been
  +    %% received, otherwise, our shepherd should have kicked in (a send_error
  +    %% will then be in our message queue)
  +
  +    %% search for trace with status delivered, Pid and Ref
  +    StateTail = lists:dropwhile(fun({_TraceId, X}) ->
  +                                        case X#state.status of
  +                                            {delivered, _Pid, Ref, _Time} ->
  +                                                false;
  +                                            _ -> true
  +                                        end end,
  +                                State),
  +    case StateTail of
  +        [] -> State; %% outdated 'DOWN' message - ok
  +        [TraceEntry | _] ->
  +            %% log:log("proto_sched:on({'DOWN', ~p, process, ~p, ~p}).",
  +            %%         [Ref, Pid, Reason]),
  +            %% the process we delivered to has died, so we generate a
  +            %% gc_on_done message ourselves.
  +            %% use post_op to avoid concurrency with send_error
  +            %% message when delivering to already dead nodes.
  +            gen_component:post_op({on_handler_done,
  +                                   element(1, TraceEntry),
  +                                   pid_ended_died_or_killed,
  +                                   comm:make_global(Pid)}, State)
  +    end;
   
   on({check_slow_handler_trigger}, State) ->
       msg_delay:send_trigger(1, {check_slow_handler_trigger}),
  
positive.code:              State;
           {TraceId, TraceEntry} ->
               case TraceEntry#state.status of
                   {delivered, To, Ref, _Time, _OldSendOptions} ->
                       %% this delivered was done, so we can schedule a new msg.
                       erlang:demonitor(Ref, [flush]),
  
  
negative.code:             %% still waiting for all threads to join
              ?DBG_ASSERT2(UMsg =:= {thread_release_to_run}, wrong_starting_msg),
              lists:keystore(TraceId, 1, State, {TraceId, TmpEntry});
          {delivered, FromGPid, _Ref, _DeliverTime} ->
              %% only From is allowed to enqueue messages
              %% only when delivered or to_be_cleaned (during execution
              %% of a scheduled piece of code) new arbitrary messages
  