Move on-the-side database processing into update_events.py - #389
Merged
Conversation
taldcroft
force-pushed
the
update-events-on-local-copy
branch
from
August 13, 2026 14:35
e12dcca to
48b01dc
Compare
jeanconn
reviewed
Aug 18, 2026
jeanconn
requested changes
Aug 18, 2026
jeanconn
left a comment
Contributor
There was a problem hiding this comment.
Docstring should include a note indicating that --process-dir needs to be on the same disk mount as the flight KADI dir.
jeanconn
approved these changes
Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Previously,
task_schedule_events.cfgshelled out tomkdir/cp/mvaround eachkadi_update_eventscron run to process a scratch copy ofevents3.db3, then unconditionally moved that copy back over the production file — even when nothing had actually changed. Since the events database only changes roughly once every 8 hours (when new telemetry arrives), the production file was being needlessly touched on every 10-minute tick.Changes
--process-diroption toupdate_events.py. When set (absolute, or relative to--data-root), the productionevents3.db3is copied into that directory and processed there instead of in place.os.replace) if it actually changed. If unchanged, production is left untouched.--update-diris not provided, behavior is unchanged: the database is updated in place in--data-root.update_events()function somain()can run the compare/move logic after it regardless of early returns (e.g. "no new MAUDE telemetry").task_schedule_events.cfgto a singlekadi_update_events --data-root=... --update-dir=update_events --maudecall, removing the separatemkdir/cp/mvexec lines.Test plan
--update-dirpaths work, and the copy step is skipped/re-triggered correctly across repeated runs.ruff checkpasses onupdate_events.py.events3.db3with--maudein a staging-like environment before deploying the updated cron config.Interface impacts
Testing
Unit tests
Independent check of unit tests by [REVIEWER NAME]
Functional tests
Local mac testing by hand
On my mac, I copied the
events3.db3from Ska data. It happened to be 6 days old because I hadn't synced since then. I then ran the following commands from the top of the git repo:After each command I examine the files in
process_events, confirming that either theprocess_events/events3.db3was there and unchanged, or that it had been moved to./events3.db3. The logging outputs were as expected.Soak test on linux (kady)
I set up a dedicated dev ska and it is now running every 10 minutes:
As of Aug 18, the log shows that this is working as expected. The only small surprise is that sometimes there are two updates (10 minutes apart) after one comm. This is presumably due to the updates occuring during MAUDE ingest so that both times MAUDE reports having new telemetry. I think this is benign and we do want to ensure that kadi events are fully caught up with MAUDE after each comm.
Most of the processing jobs end like this: