-
Notifications
You must be signed in to change notification settings - Fork 19
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
Help wanted: Bug & MySQL C API review #57
Comments
started adding an isolation case: 77320ba |
I believe this issue was successfully replicated here (commit 7d946d9) https://github.com/NagiosEnterprises/ndoutils/blob/7d946d9dadfda89b927a88c26b07099595b5c51b/src/bug-test.c - and this also contains the fix. Which ...is a bit silly on my part, but that's how these things go, I suppose Line 50 in 7d946d9
|
I found this issue via your reddit post. |
@nook24 I hadn't seen that website before, that's pretty nice! I think for now we still need to have a solution that we "control", but the approach for your project is certainly interesting. |
Any news about |
Yea, I suppose I can give an update:
|
Is @hedenface not working on Nagios projects anymore?
This sounds great. But was NDOUtils producing this high load or Nagios Core itself? Or some other process.
That's too bad - even if I didn't used NDO since November 2014 |
Currently working through a complete rewrite of NDOUtils (check the
ndo-3
branch).One of the goals is to remove the necessity of the kernel message queue, as this is the source of many admin headaches in larger nagios systems.
I've currently hit a roadblock, and was curious if any previous or new contributors to core or ndo would be willing to take a look and get some fresh eyes on it. @knweiss comes to mind immediately.
Here's the main issue - I'm attempting to save a lot of individual insert calls to mysql by building several bulk inserts on a loop. Well, originally during the rewrite we were doing individual inserts for brevity and to get it working, but initial performance testing once complete revealed that something needed to change immediately. https://github.com/NagiosEnterprises/ndoutils/blob/ndo-3/src/ndo-startup.c#L527-L810 Here is
ndo_write_hosts
- all of the ancillary data (host's parent hosts/contacts/contactgroups/customvars) revolve on the host already existing in thenagios_hosts
table. So we loop over all hosts, build the appropriate queries, insert the data, repeat until all hosts have been inserted. THEN we loop over them again, and build numerous queries for each of the related objects.This all works, except once it gets to the custom variables, I get a segfault. I've narrowed this down and what seems like is happening is that (
char *
)var_query_on_update
is simply not readable any longer. On a large system, 15k+ hosts, it usually will start erroring around the 500th host (no matter how big (or small) thendo_max_insert_values
integer is set to (viando.cfg
).If anyone has time to review the code and help out - we'd certainly appreciate it.
Likewise, if anyone has any experience with the mysql c api and can point out some flaw or something that is going to blow up one day with this code, that would also be appreciated. (Keep in mind that all of the functions in
ndo-startup.c
are currently undergoing being re-written to thendo_write_hosts
andndo_write_services
pattern of insertion)Thanks!
The text was updated successfully, but these errors were encountered: