Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Builder: _ACTIVE_TELEMETRY is never cleared after a completed run, so an early exit in a later in-process main() call marks the PRIOR staging run failed

Open
#751 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
70/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
cli, release, tooling

Research direction

Start in tools/build_us_fiscal_refresh_release.py, following main(), _staging_telemetry(), and the _ACTIVE_TELEMETRY global. Reproduce two in-process main() calls where the second exits early, then add the consecutive-invocation regression test described in the issue. Done means the second call does not mutate or re-upload the first run's telemetry.

Written by the indexing model from the issue text.

Description

Surfaced by the sol round-3 review of PR #674 (evidence tier) as PLAUSIBLE, pre-existing on main since #563's main()→_main() wrapper.

Mechanics (tools/build_us_fiscal_refresh_release.py): _ACTIVE_TELEMETRY is a module global set/reset only inside _staging_telemetry(); telemetry.complete() does not clear it. The main() wrapper calls _ACTIVE_TELEMETRY.fail(error) on any BaseException. So in one Python process, after a completed staging-enabled run, a second main() invocation that exits BEFORE _staging_telemetry() runs — argparse SystemExit, the dirty-worktree SystemExit, _refuse_certified_release_dir_reuse, or (#674) a malformed --evidence-failure-owners file — rewrites/re-uploads the PRIOR run as failed.

Reachability: nil for one-process-per-CLI-run usage (every launcher today); real for any driver or test harness that invokes main() repeatedly in-process.

Minimal fix: clear _ACTIVE_TELEMETRY = None at main() entry (and in a finally after the failure report), keeping the current run referenced long enough for exception reporting; plus a consecutive-invocation regression test asserting an early-exit second call never mutates the first run's telemetry. Left to the #563 lane rather than folded into #674, which only adds one more early-exit site to a pre-existing set.

🤖 Generated with Claude Code

Dominant language
Python
Stars
0
Forks
4
Avg merge
1d 15h
Merged PRs (30d)
104

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PolicyEngine/microcosm

All issues in PolicyEngine/microcosm

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.