Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

long status file parse time causes incomplete object with background parsing enabled #20

Closed
ivan-gusev opened this issue Mar 25, 2013 · 2 comments

Comments

@ivan-gusev
Copy link
Contributor

We have huge status file(16M) so I was hoping that background parsing would help us a lot. Unfortunately I had to rollback due to an issue when api calls are made while nagios[:status] still being populated - this causes 404 errors in cases where we get hostgroups and then query hostgroup members for particular service (that is present for every hostgroup member).

I tried to fix this issue with simple mutex.synchronize around parse! in bg thread and having mutex.synchronize in "before do", but it essentially disables background parsing because all http threads have to wait for bg thread to complete parsing.

The right way of dealing with this situation would be having an active nagios[:status] instance and "being populated" instance and swap them (or reference) once parsing is complete. I'll try to implement something like this myself, but I wonder if Dmytro has any better ideas on how to tackle this problem.

@dmytro
Copy link
Owner

dmytro commented Mar 26, 2013

The right way of dealing with this situation would be having an active nagios[:status] instance and "being populated" instance and swap them (or reference) once parsing is complete.

To say the truth I don't see any better solution for this.

Another option is not deleting parsed status data before next parse (it's implemented ruby-nagios now). In this case older status will still be available while parsing new. However, this leads to the situation, that deleted from Nagios hosts are still remaining in nagios[:status] hash.

ivan-gusev added a commit to ivan-gusev/nagira that referenced this issue Mar 26, 2013
dmytro added a commit that referenced this issue Mar 26, 2013
@dmytro
Copy link
Owner

dmytro commented Mar 26, 2013

Thank you. Appreciate your help.

@dmytro dmytro closed this as completed Mar 26, 2013
dmytro added a commit that referenced this issue Mar 26, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants