# Buggy code
def __init__(
    self,
    scheduler: Scheduler,
    period_secs=10,
    lease_extension_interval_secs=(30 * 60),
    gc_interval_secs=(4 * 60 * 60),
):
    super().__init__()
    self._scheduler_session = scheduler.new_session(
        zipkin_trace_v2=False, build_id="store_gc_service_session"
    )
    self._logger = logging.getLogger(__name__)

    self._period_secs = period_secs
    self._lease_extension_interval_secs = lease_extension_interval_secs
    self._gc_interval_secs = gc_interval_secs

    self._set_next_gc()
    self._set_next_lease_extension()


# 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 __init__(
    self,
    scheduler: Scheduler,
    period_secs=10,
    lease_extension_interval_secs=(15 * 60),
    gc_interval_secs=(1 * 60 * 60),
    target_size_bytes=(4 * 1024 * 1024 * 1024),
):
    super().__init__()
    self._scheduler_session = scheduler.new_session(
        zipkin_trace_v2=False, build_id="store_gc_service_session"
    )
    self._logger = logging.getLogger(__name__)

    self._period_secs = period_secs
    self._lease_extension_interval_secs = lease_extension_interval_secs
    self._gc_interval_secs = gc_interval_secs
    self._target_size_bytes = target_size_bytes

    self._set_next_gc()
    self._set_next_lease_extension()