Trigger daemon is trying to find the next event to invoke before sleeping, but the query includes already-elapsed triggers.
It then tries to sleep for 0 seconds.
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Commits
- rPa3bb35e9d20a: make Trigger Daemon sleep correctly when one-time triggers exist
On a new instance, schedule a single trigger of type PhabricatorOneTimeTriggerClock to a very near time.
Use top to see trigger daemon not going to 100% CPU once the event has elapsed.
Diff Detail
- Repository
- rP Phabricator
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
src/infrastructure/daemon/workers/PhabricatorTriggerDaemon.php | ||
---|---|---|
264 | Maybe correct this to "sleep briefly" instead of "sleep for 60 seconds", since the actual value is currently 5 rather than 60. (The 5 is probably debug code I neglected to strip out of D11872 since it appears in my test plan, but now that we do nuance imports here too I think it makes sense to leave it pretty small so nuance imports can be prompt.) |
Yes, that does look bad.
setOrder(PhabricatorWorkerTriggerQuery::ORDER_EXECUTION) doesn't imply "has NextEvent".
withNextEventBetween(0, null) means "nextEvent >=0", which is false for NULL in sql.
Maybe better to have an explicit ->withNextEvent($true) call instead of this funnyness?