-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZED/zfs-list-cacher.sh: don't exit on ignored event type #11347
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd forgotten these were used by the zfs-list-cacher
mechanism as well. The idea here as explained in the comment above was to only exclude them from syslog by default. What if instead of changing this default we removed the zed_exit_if_ignoring_this_event
check from zfs-list-cacher.sh/in
and replaced it with a check to only act on history events.
Your suggestion sounds like the best of both worlds. I see no reason not to go that way but I'm also not familiar with ZED's architecture, as proven above. |
Something like this should do the job, though I haven't tested it. The ZED calls each registered zedlet for each event, so it need only exit. If you could verify this does work and update the PR I think this would be a reasonable way to handle it. -zed_exit_if_ignoring_this_event
+[ "$ZEVENT_SUBCLASS" != "history" ] && exit 0 |
Thanks. I was a little fast on pushing this, but wondered whether the switch case was enough of a check, since the old exit never protected us from non-history events anyway. |
9d017a9
to
975391c
Compare
Check for the history_event type instead. The zfs-list-cacher.sh script currently respects the event types excluded from syslog(!) in ZED_SYSLOG_SUBCLASS_EXCLUDE. This makes little sense in this single-purpose script and silently breaks when history_events are excluded from syslog, which is the default since 13d6598. Closes openzfs#11164 Signed-off-by: InsanePrawn <insane.prawny@gmail.com>
975391c
to
2b1854a
Compare
Yeah I noticed the same thing. It probably would be fine, but I figured we might as well make it explicit and do the check early. |
@behlendorf Thanks for the guidance and merging! |
In fact there will be 2.0.x releases: I went ahead and created a zfs-2.0.1-staging branch. Yes, I think it would be good to create one with each release. |
Check for the history_event type instead. The zfs-list-cacher.sh script currently respects the event types excluded from syslog(!) in ZED_SYSLOG_SUBCLASS_EXCLUDE. This makes little sense in this single-purpose script and silently breaks when history_events are excluded from syslog, which is the default since 13d6598. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: InsanePrawn <insane.prawny@gmail.com> Closes openzfs#11164 Closes openzfs#11347
Check for the history_event type instead. The zfs-list-cacher.sh script currently respects the event types excluded from syslog(!) in ZED_SYSLOG_SUBCLASS_EXCLUDE. This makes little sense in this single-purpose script and silently breaks when history_events are excluded from syslog, which is the default since 13d6598. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: InsanePrawn <insane.prawny@gmail.com> Closes #11164 Closes #11347
Check for the history_event type instead. The zfs-list-cacher.sh script currently respects the event types excluded from syslog(!) in ZED_SYSLOG_SUBCLASS_EXCLUDE. This makes little sense in this single-purpose script and silently breaks when history_events are excluded from syslog, which is the default since 13d6598. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: InsanePrawn <insane.prawny@gmail.com> Closes openzfs#11164 Closes openzfs#11347
Check for the history_event type instead. The zfs-list-cacher.sh script currently respects the event types excluded from syslog(!) in ZED_SYSLOG_SUBCLASS_EXCLUDE. This makes little sense in this single-purpose script and silently breaks when history_events are excluded from syslog, which is the default since 13d6598. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: InsanePrawn <insane.prawny@gmail.com> Closes openzfs#11164 Closes openzfs#11347
Motivation and Context
13d6598 excluded history_events from logging by default.
This breaks the zfs-list caching mechanism as it listens for those events to trigger cache updates.
Closes #11164.
Description
This change simply stops ignoring history_event type events again.
I suppose @don-brady wasn't aware of these being used by the zfs-list-cacher -> mount generator?
Alternatively, one could suggest leaving the new default and adding the configuration change to zfs-mount-generator(8), making the instructions to get it up and running a little more obscure-seeming and harder to properly automate when you want to preserve existing excludes in the file, with the advantage of a possibly maybe sleeker UX for everyone else. While I understand the argument, especially now that this isn't just ZFS on Linux anymore, this would not be my preferred solution.
How Has This Been Tested?
Manually in my zed.rc, change works as expected after restarting ZED.
Types of changes
Checklist:
Signed-off-by
.