[Arch] Overuse of module-level global state for cross-request coordination (informational) #69
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: Low | Category: Architecture
_write_timestamps,_ingest_timestamps(main.py),_last_manual_scrape(scheduler.py),_login_attempts(auth.py) are plain module-level mutable globals shared across concurrent requests and the background scheduler task.Recommendation: No urgent action — safe under the current single-instance, single-process deployment (an equivalent trade-off is already made consciously in
notifiers/mqtt.py, per docs/architecture.md). If multi-instance deployment is ever planned, this is the exact list of state that needs to move to a shared store first.Full detail:
docs/architecture-review.md§ C, Finding "Overuse of module-level global state..." and § GClosing without a code change. This finding was explicitly informational in
docs/architecture-review.md: "No urgent action — safe under the current single-instance, single-process deployment... If multi-instance deployment is ever planned, this is the exact list of state that needs to move to a shared store first." All other actionable findings from the review have now been implemented onarchitecture-rework. Re-open if multi-instance deployment is ever planned — the finding body lists the exact globals (_write_rate_limiter/_ingest_rate_limiter/_manual_scrape_rate_limiterafter the rate_limit.py consolidation, plus_login_attemptsin auth.py) that would need to move to shared storage first.