anchor.diff:              {ok, {next, State_1}} ->
                   ok = run(Id, IsDiagnose),
                   {?ST_RUNNING, State_1};
  +
               %% An unxepected error has occured
               {'EXIT', Cause} ->
  -                ok = finish(State#state{result = ?RET_FAIL}),
  -                ok = after_execute({error, Cause}, State),
  -                {?ST_IDLING, #state{}};
  +                {ok, State_1} = after_execute({error, Cause},
  +                                              State#state{result = ?RET_FAIL}),
  +                {?ST_IDLING, State_1};
               %% Reached end of the object-container
               {ok, {eof, State_1}} ->
  -                ok = finish(State_1#state{result = ?RET_SUCCESS}),
  -                ok = after_execute(ok, State_1),
  -                {?ST_IDLING, #state{}};
  +                {ok, State_2} = after_execute(ok,
  +                                              State_1#state{result = ?RET_SUCCESS}),
  +                {?ST_IDLING, State_2};
               %% An epected error has occured
               {{error, Cause}, State_1} ->
  -                ok = finish(State_1#state{result = ?RET_FAIL}),
  -                ok = after_execute({error, Cause}, State_1),
  -                {?ST_IDLING, #state{}}
  +                {ok, State_2} = after_execute({error, Cause},
  +                                              State_1#state{result = ?RET_FAIL}),
  +                {?ST_IDLING, State_2}
           end,
       {next_state, NextStatus, State_3#state{status = NextStatus,
                                              num_of_batch_procs = NumOfBatchProcs_1}};
  
positive.code: 
      %% Unlock handling request
      ok = leo_object_storage_server:unlock(ObjStorageId),
      ok.
  
  %% @private
  after_execute(Ret, #state{obj_storage_info = StorageInfo,
  
negative.code:           diagnosis_log_id       :: atom(),
            status = ?ST_IDLING    :: compaction_state(),
            is_locked = false      :: boolean(),
            is_diagnosing = false  :: boolean(),
            waiting_time = 0       :: non_neg_integer(),
            max_waiting_time = 0   :: non_neg_integer(),
  