# Buggy code
def _maybe_garbage_collect(self):
    if time.time() < self._next_gc:
        return
    self._logger.info("Garbage collecting store")
    self._scheduler_session.garbage_collect_store()
    self._logger.info("Done garbage collecting store")
    self._set_next_gc()


# Traceback (pants.engine.internals.scheduler.ExecutionError)
18:08:49.83 [WARN] <unknown>:882: DeprecationWarning: invalid escape sequence \d
18:08:52.21 [WARN] Completed: Find PEX Python - No bootstrap Python executable could be found from the option `interpreter_search_paths` in the `[python-setup]` scope. Will attempt to run PEXes directly.
18:08:53.11 [WARN] /data/home/asher/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0a1_py38/lib/python3.8/site-packages/pants/base/exception_sink.py:359: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
process_title=setproctitle.getproctitle(),

18:08:53.11 [ERROR] 1 Exception encountered:

Engine traceback:
in select
in `binary` goal
in pants.backend.python.rules.create_python_binary.create_python_binary
in pants.backend.python.rules.pex.two_step_create_pex
in pants.backend.python.rules.pex.create_pex
Traceback (no traceback):
<pants native internals>
Exception: String("Digest Digest(Fingerprint<97adba2ad1bfef3ba1b37d6b119e15498ed2a60392241b5ea7c28c602826dd6c>, 97) did not exist in the Store.")
Traceback (most recent call last):
File "/data/home/asher/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0a1_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 255, in run
engine_result = self._run_v2()
File "/data/home/asher/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0a1_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 166, in _run_v2
return self._maybe_run_v2_body(goals, poll=False)
File "/data/home/asher/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0a1_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 183, in _maybe_run_v2_body
return self.graph_session.run_goal_rules(
File "/data/home/asher/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0a1_py38/lib/python3.8/site-packages/pants/init/engine_initializer.py", line 130, in run_goal_rules
exit_code = self.scheduler_session.run_goal_rule(
File "/data/home/asher/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0a1_py38/lib/python3.8/site-packages/pants/engine/internals/scheduler.py", line 561, in run_goal_rule
self._raise_on_error([t for _, t in throws])
File "/data/home/asher/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0a1_py38/lib/python3.8/site-packages/pants/engine/internals/scheduler.py", line 520, in _raise_on_error
raise ExecutionError(
pants.engine.internals.scheduler.ExecutionError: 1 Exception encountered:

Engine traceback:
in select
in `binary` goal
in pants.backend.python.rules.create_python_binary.create_python_binary
in pants.backend.python.rules.pex.two_step_create_pex
in pants.backend.python.rules.pex.create_pex
Traceback (no traceback):
<pants native internals>
Exception: String("Digest Digest(Fingerprint<97adba2ad1bfef3ba1b37d6b119e15498ed2a60392241b5ea7c28c602826dd6c>, 97) did not exist in the Store.")

# Fixed code
def _maybe_garbage_collect(self):
    if time.time() < self._next_gc:
        return
    self._logger.info("Garbage collecting store")
    self._scheduler_session.garbage_collect_store(self._target_size_bytes)
    self._logger.info("Done garbage collecting store")
    self._set_next_gc()