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

Better Error logging on disk_total_space failure #1407

Merged
merged 1 commit into from Apr 9, 2016

Conversation

connortechnology
Copy link
Member

No description provided.

@knight-of-ni
Copy link
Member

Should we add the same kind of check to disk_free_space as well, just a couple lines down?

@knight-of-ni
Copy link
Member

hmmmm.... looks like this commit is also in #1409 so perhaps we can close this pr out.

@knight-of-ni knight-of-ni merged commit e90024c into master Apr 9, 2016
@connortechnology
Copy link
Member Author

yeah we should find and fix all cases where we dont handle failure

@@ -1668,6 +1668,10 @@ function getLoad()
function getDiskPercent()
{
$total = disk_total_space(ZM_DIR_EVENTS);
if ( ! $total ) {
Error("disk_total_space returned false for " . ZM_DIR_EVENTS );
return 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking about the value we should return if disk_total_space fails:

  • If we return 0, then the purge filter will not trigger and zoneminder will keep recording until writes fail due to disk full. I believe Zoneminder will simply stop running when this happens with a failed to write to disk message.
  • if we return 100, then that will cause the purge filter to continually execute because it incorrectly thinks the disk is full. All events will eventually get deleted.
  • if we return -1 to signal there was an error, then perhaps we can write additional code to handle that response and/or alert the user.

Thoughts?
Should we consider the third option?

@connortechnology
Copy link
Member Author

Well, I definitely wouldn't want events deleted due to a bug. So we can't return 100. -1 is probably the best thing to do.

Filters actually run in the perl code, so this would only affect manual filter runs.

@connortechnology connortechnology deleted the disk_total_space_error branch April 11, 2016 15:11
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

Successfully merging this pull request may close these issues.

None yet

2 participants