Repository navigation
Conversation
| { | ||
| char *path; | ||
| time_t last_seen; /* Time the file was last observed present, 0 if absent */ | ||
| bool lstat_failing; /* Whether the last lstat() failed, to log a failure only once */ |
There was a problem hiding this comment.
Is this necessary? Won't the event only be triggered once? Or is it being re-triggered repeatedly? It should probably only be triggered once on the actual event of deleting it.
There was a problem hiding this comment.
The function FileDeleted is running continuously inside WatcherThreadMain. So if it has an error, it would spam the error output. This flag was to prevent that.
I changed it now to print the error every LSTAT_ERROR_LOG_INTERVAL_SECS instead
There was a problem hiding this comment.
But should not the event only be triggered once? If it fails to fix it, then the agent will hopefully fix it later?
There was a problem hiding this comment.
FileDeleted is run continuously to detect events. If it fails for whatever reason, then the watcher thread will push a single event that it failed. As long as it (the thread) receives the failure, it will not push any event until the error is fixed.
Then, when handling the event, the evaluator sees that the event has an error, and instead of runnnig the "then" bundle, it will return early, and record the outcome of the promise as FAILED
43a6fea to
bd51630
Compare
Signed-off-by: Victor Moene <victor.moene@northern.tech> Ticket: ENT-14695
Logs errors every minute instead of on every poll Signed-off-by: Victor Moene <victor.moene@northern.tech>
Signed-off-by: Victor Moene <victor.moene@northern.tech>
bd51630 to
fd591bb
Compare
|
@cf-bottom jenkins, please :) |
|
Alright, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/14772/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-14772/ |
No description provided.