Skip to content

auto_load true start without saved state on first boot#179

Open
thorinaboenke wants to merge 2 commits into
developmentfrom
fix/persistency_with_service
Open

auto_load true start without saved state on first boot#179
thorinaboenke wants to merge 2 commits into
developmentfrom
fix/persistency_with_service

Conversation

@thorinaboenke

@thorinaboenke thorinaboenke commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Task

#178

Description

Catch PersistencyLoadError during the auto-load init and log an info message instead of raising:

How Has This Been Tested?

new unit test in detectmatelibrary_tests/test_utils/test_persistency_saver.py

Manual end-to-end test (Docker Compose getting-started setup in DetectMateService) on branch https://github.com/ait-detectmate/DetectMateService/tree/feature/persistency-admin-endpoints

  1. Added persist: { path: /state, auto_load: true } to container/config/detector_config.yaml with no prior saved state.
  2. Started the stack, detector came up cleanly. /admin/persistency/status returned events_seen_count: 0, last_saved_at: null, confirming the first-boot path no longer crashes.
  3. Sent two nginx requests (/hello, /world) to feed training data. Status showed events_seen_count: 2, events_since_save: 4
  4. Called POST /admin/persistency/save. Response {"message": "state saved"}. State files confirmed on disk (metadata.json + *.msgpack). Status showed events_since_save: 0 and last_saved_at populated.
  5. Restarted the detector container (docker compose restart detector). After startup, status showed events_seen_count: 2, events_with_data_count: 1. state fully restored via auto_load on restart.

Checklist

  • This Pull-Request goes to the development branch.
  • I have successfully run prek locally.
  • I have added tests to cover my changes.
  • I have linked the issue-id to the task-description.
  • I have performed a self-review of my own code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant