Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • NetworkManager NetworkManager
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 172
    • Issues 172
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • NetworkManager
  • NetworkManagerNetworkManager
  • Merge requests
  • !1171

[th/timestamps-periodic-update] core: don't update connection timestamps periodically every 300 seconds

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Thomas Haller requested to merge th/timestamps-periodic-update into main Mar 31, 2022
  • Overview 3
  • Commits 1
  • Pipelines 1
  • Changes 1

We store the timestamp when a profile activated the last time to "/var/lib/NetworkManager/timestamps". There was also a timer which would update the timestamp of activated connections every 300 seconds.

That seems unnecessary, drop it.

For one, waking up every 5 minutes and rewriting a file to disk seems undesirable, for example if /var is a device where unnecessary writes should be minimized.

Note that we already update the timestamp when a device goes down, and of course when it comes up. Updating the timestamp in between seems unnecessary.

This reverts commit 60735029 ('core: update timestamp in active system connections every 5 mins (bgo #583756)').

An alternative would be to only update the timestamp in memory (so that it would appear updated on D-Bus), but delay writing the file until something important happens. nm_key_file_db_*() already tracks whether there are changes ("dirty") and whether it's necessary to write the file. It would be possible to track two dirty flags: one that requires immediate update, and one that only ensures we will re-write dirty files eventually.

See-also: https://bugzilla.gnome.org/show_bug.cgi?id=583756


Inspired by https://unix.stackexchange.com/questions/694260/how-to-prevent-networkmanager-from-writing-timestamps-to-var-lib-networkmanager

Edited Apr 01, 2022 by Thomas Haller
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: th/timestamps-periodic-update