# Buggy code
def UpdateWorkerStatus(
    self,
    identifier,
    status,
    pid,
    display_name,
    number_of_consumed_sources,
    number_of_produced_sources,
    number_of_consumed_events,
    number_of_produced_events,
    number_of_consumed_errors,
    number_of_produced_errors,
    number_of_consumed_reports,
    number_of_produced_reports,
):
    """Updates the status of a worker.

    Args:
      identifier (str): worker identifier.
      status (str): human readable status of the worker e.g. 'Idle'.
      pid (int): process identifier (PID).
      display_name (str): human readable of the file entry currently being
          processed by the worker.
      number_of_consumed_sources (int): total number of event sources consumed
          by the worker.
      number_of_produced_sources (int): total number of event sources produced
          by the worker.
      number_of_consumed_events (int): total number of events consumed by
          the worker.
      number_of_produced_events (int): total number of events produced by
          the worker.
      number_of_consumed_errors (int): total number of errors consumed by
          the worker.
      number_of_produced_errors (int): total number of errors produced by
          the worker.
      number_of_consumed_reports (int): total number of event reports consumed
          by the process.
      number_of_produced_reports (int): total number of event reports produced
          by the process.
    """
    if identifier not in self._workers_status:
        self._workers_status[identifier] = ProcessStatus()

    process_status = self._workers_status[identifier]
    self._UpdateProcessStatus(
        process_status,
        identifier,
        status,
        pid,
        display_name,
        number_of_consumed_sources,
        number_of_produced_sources,
        number_of_consumed_events,
        number_of_produced_events,
        number_of_consumed_errors,
        number_of_produced_errors,
        number_of_consumed_reports,
        number_of_produced_reports,
    )


# 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 UpdateWorkerStatus(
    self,
    identifier,
    status,
    pid,
    display_name,
    number_of_consumed_sources,
    number_of_produced_sources,
    number_of_consumed_events,
    number_of_produced_events,
    number_of_consumed_event_tags,
    number_of_produced_event_tags,
    number_of_consumed_errors,
    number_of_produced_errors,
    number_of_consumed_reports,
    number_of_produced_reports,
):
    """Updates the status of a worker.

    Args:
      identifier (str): worker identifier.
      status (str): human readable status of the worker e.g. 'Idle'.
      pid (int): process identifier (PID).
      display_name (str): human readable of the file entry currently being
          processed by the worker.
      number_of_consumed_sources (int): total number of event sources consumed
          by the worker.
      number_of_produced_sources (int): total number of event sources produced
          by the worker.
      number_of_consumed_events (int): total number of events consumed by
          the worker.
      number_of_produced_events (int): total number of events produced by
          the worker.
      number_of_consumed_event_tags (int): total number of event tags consumed
          by the worker.
      number_of_produced_event_tags (int): total number of event tags produced
          by the worker.
      number_of_consumed_errors (int): total number of errors consumed by
          the worker.
      number_of_produced_errors (int): total number of errors produced by
          the worker.
      number_of_consumed_reports (int): total number of event reports consumed
          by the process.
      number_of_produced_reports (int): total number of event reports produced
          by the process.
    """
    if identifier not in self._workers_status:
        self._workers_status[identifier] = ProcessStatus()

    process_status = self._workers_status[identifier]
    self._UpdateProcessStatus(
        process_status,
        identifier,
        status,
        pid,
        display_name,
        number_of_consumed_sources,
        number_of_produced_sources,
        number_of_consumed_events,
        number_of_produced_events,
        number_of_consumed_event_tags,
        number_of_produced_event_tags,
        number_of_consumed_errors,
        number_of_produced_errors,
        number_of_consumed_reports,
        number_of_produced_reports,
    )