mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2024-12-25 22:55:55 -05:00
c271cfa2b5
My installation recently somehow ended up with a recording with a duration of 503793844 90,000ths of a second, way over the maximum of 5 minutes. (Looks like the machine was pretty unresponsive at the time and/or having network problems.) When this happens, the system really spirals. Every flush afterward (12 per minute with my installation) fails with a CHECK constraint failure on the recording table. It never gives up on that recording. /var/log fills pretty quickly as this failure is extremely verbose (a stack trace, and a line for each byte of video_index). Eventually the sample file dirs fill up too as it continues writing video samples while GC is stuck. The video samples are useless anyway; given that they're not referenced in the database, they'll be deleted on next startup. This ensures the offending recording is never added to the database, so we don't get the same persistent problem. Instead, writing to the recording will fail. The stream will drop and be retried. If the underlying condition that caused a too-long recording (many non-key-frames, or the camera returning a crazy duration, or the monotonic clock jumping forward extremely, or something) has gone away, the system should recover. |
||
---|---|---|
.. | ||
testdata | ||
upgrade | ||
auth.rs | ||
Cargo.toml | ||
check.rs | ||
coding.rs | ||
db.rs | ||
dir.rs | ||
lib.rs | ||
raw.rs | ||
recording.rs | ||
schema.proto | ||
schema.rs | ||
schema.sql | ||
testutil.rs | ||
writer.rs |