tiny-pilot / tiny-pilot/tinypilot

System clock updates can cause a TinyPilot update to time out

Open Beginner friendly
#1,419 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug medium
Dominant language
Python
Stars
3.5k
Forks
291
PR merge metrics
No merged PRs in 30d

Description

TinyPilot's update service times out if the update takes longer than 10 minutes.

The problem is that TinyPilot has no real time clock and relies on NTP to set time. Every time the Pi shuts off, its system clock falls behind until it contacts NTP to get the latest time.

If the system time updates in the middle of a TinyPilot update, the time jump forward will fool the update process into thinking that the update has timed out.

Example: https://github.com/tiny-pilot/tinypilot/issues/1392#issuecomment-1571733803

It's probably possible to avoid this by timing out based on a monotonic timer that doesn't change due to system time updates like time.monotonic.

Contributor guide

Open the contributing guide

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.

Research direction

Start by reading scripts/update-service, especially the timeout logic linked in the issue, and review Python's time.monotonic documentation. Verify that a system clock update during an update no longer causes the ten-minute timeout to trigger; use the issue's example as context for the expected failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, raspberry-pi
Domain
operating-systems, release
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.