Page MenuHomePhabricator

Allow the Trigger daemon to hibernate, reducing processes to 0
ClosedPublic

Authored by epriestley on Feb 24 2017, 5:14 PM.
Tags
None
Referenced Files
F14036714: D17408.diff
Sun, Nov 10, 11:45 AM
F14034990: D17408.id41863.diff
Sun, Nov 10, 3:23 AM
F13983265: D17408.diff
Sun, Oct 20, 5:10 AM
F13973373: D17408.diff
Fri, Oct 18, 12:39 AM
Unknown Object (File)
Sun, Oct 13, 9:31 PM
Unknown Object (File)
Oct 9 2024, 7:32 AM
Unknown Object (File)
Sep 20 2024, 4:44 PM
Unknown Object (File)
Sep 20 2024, 1:37 PM
Subscribers
None

Details

Summary

Ref T12298. The trigger daemon already has routine long-term sleep, and few external events can impact when it should ideally wake up. The relevant events are:

  • Someone creates a new Nuance source (ideally, we should wake up right away and start polling it).
  • Someone creates a Calendar event about 16 minutes in the future (ideally, we should send them a reminder in about a minute).
  • Someone changes GC config to be extremely aggressive (ideally, we should immediately respect the change).

None of these cases are very important. We don't hibernate for more than 3 minutes, so the worst case is that your Nuance source takes 3 minutes to start importing or your Calendar notification comes two minutes too late (13 minutes before the event instead of 15).

This change makes GC sightly more CPU-expensive on average: currently, we do a GC sweep every 4 hours. After this change, we'll end up doing one every 3 minutes, because we lose the fact that we did a sweep recently when the daemon restarts.

We could fix this by keeping track of when the last GC sweep was in the database, instead of in the Daemon process, but the cost of a sweep is normally very small so I don't plan to do this anytime soon.

Test Plan
  • Ran bin/phd debug trigger, saw daemon go through 3-minute hibernate + restart cycles.
  • Ran bin/phd debug task, saw daemon run normally.

Diff Detail

Repository
rP Phabricator
Branch
daemon2
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 15757
Build 20828: Run Core Tests
Build 20827: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Feb 24 2017, 5:36 PM
This revision was automatically updated to reflect the committed changes.