# Buggy code
def _UpdateStatus(
    self, status, display_name, number_of_consumed_sources, storage_writer, force=False
):
    """Updates the processing status.

    Args:
      status (str): human readable status of the processing e.g. 'Idle'.
      display_name (str): human readable of the file entry currently being
          processed.
      number_of_consumed_sources (int): number of consumed sources.
      storage_writer (StorageWriter): storage writer for a session storage.
      force (Optional[bool]): True if the update should be forced ignoring
          the last status update time.
    """
    current_timestamp = time.time()
    if not force and current_timestamp < (
        self._last_status_update_timestamp + self._STATUS_UPDATE_INTERVAL
    ):
        return

    if status == definitions.PROCESSING_STATUS_IDLE:
        status = definitions.PROCESSING_STATUS_RUNNING

    self._processing_status.UpdateForemanStatus(
        self._name,
        status,
        self._pid,
        display_name,
        number_of_consumed_sources,
        storage_writer.number_of_event_sources,
        0,
        storage_writer.number_of_events,
        0,
        storage_writer.number_of_errors,
        0,
        0,
    )

    if self._status_update_callback:
        self._status_update_callback(self._processing_status)

    self._last_status_update_timestamp = current_timestamp


# Traceback (KeyError)
[ERROR] (nsrlsvr   ) PID:XXXXX <analysis_process> <dfvfs.path.os_path_spec.OSPathSpec object at 0xXXXXXXXXXXXX>
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/plaso/multi_processing/analysis_process.py", line 138, in _Main
self._analysis_mediator.ProduceAnalysisReport(self._analysis_plugin)
File "/usr/lib/python2.7/dist-packages/plaso/analysis/mediator.py", line 95, in ProduceAnalysisReport
analysis_report = plugin.CompileReport(self)
File "/usr/lib/python2.7/dist-packages/plaso/analysis/interface.py", line 280, in CompileReport
hash_analysis)
File "/usr/lib/python2.7/dist-packages/plaso/analysis/interface.py", line 187, in _HandleHashAnalysis
event_uuids = self._event_uuids_by_pathspec.pop(pathspec)
KeyError: <dfvfs.path.os_path_spec.OSPathSpec object at 0xXXXXXXXXXXXX>

# Fixed code
def _UpdateStatus(
    self, status, display_name, number_of_consumed_sources, storage_writer, force=False
):
    """Updates the processing status.

    Args:
      status (str): human readable status of the processing e.g. 'Idle'.
      display_name (str): human readable of the file entry currently being
          processed.
      number_of_consumed_sources (int): number of consumed sources.
      storage_writer (StorageWriter): storage writer for a session storage.
      force (Optional[bool]): True if the update should be forced ignoring
          the last status update time.
    """
    current_timestamp = time.time()
    if not force and current_timestamp < (
        self._last_status_update_timestamp + self._STATUS_UPDATE_INTERVAL
    ):
        return

    if status == definitions.PROCESSING_STATUS_IDLE:
        status = definitions.PROCESSING_STATUS_RUNNING

    self._processing_status.UpdateForemanStatus(
        self._name,
        status,
        self._pid,
        display_name,
        number_of_consumed_sources,
        storage_writer.number_of_event_sources,
        0,
        storage_writer.number_of_events,
        0,
        0,
        0,
        storage_writer.number_of_errors,
        0,
        0,
    )

    if self._status_update_callback:
        self._status_update_callback(self._processing_status)

    self._last_status_update_timestamp = current_timestamp