Skip to content
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

How often should clear be called? In after #31

Closed
mattiasw2 opened this issue Jun 20, 2014 · 1 comment
Closed

How often should clear be called? In after #31

mattiasw2 opened this issue Jun 20, 2014 · 1 comment

Comments

@mattiasw2
Copy link

Is this the pattern to use? Always call clear if things went well regardless if there is a raise before?

try
    : code towards /dev/hda2
    ok = elarm:clear(partition_full, "/dev/hda2")
 catch
      ok = elarm:raise(partition_full, "/dev/hda2", [{level,90}])
 end
@hcs42
Copy link
Contributor

hcs42 commented Jun 20, 2014

Opinions vary :)

In my opinion, this pattern is perfectly good. We leave it to Elarm to keep track of whether the alarm has already been active, so the elarm:clear and elarm:raise calls will actually clear or raise the alarm if that is needed. There is a caveat that I described in #32: if you re-raise an alarm and change the level to let's say 92, in the current implemention the alarm will keep having the old additional info with level 90.

@nygge might not agree with me, because in issue #9, he argued that "an alarm is an indication of an error state in a component/system, so it should always know if this error state is present or not, therefore it should never raise the same alarm again if it has already been raised".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants