[icinga-devel] Make sockets non-blocking

Christoph Maser cmr at financial.com
Thu May 6 09:45:52 CEST 2010

Am Mittwoch, den 05.05.2010, 15:25 +0200 schrieb Stephen Gran:
> On Sat, May 01, 2010 at 05:03:59PM +0100, Stephen Gran said:
> > Hi there,
> >
> > We use NDO for network communication with a custom bit of perl to pass
> > status updates around.  Recently, we've seen that a network flap can
> > make ndo hang the entire nagios process, which is possibly imperfect :)
> >
> > I think I've tracked it down to the write() call in io.c when sending
> > the actual update to the remote server.  The attached patch is a
> > relatively naive attempt at making this write nonblocking for network
> > sockets.
> >
> > This is a patch against the CVS - if you prefer a git-am style patch,
> > that's fine.  I tried to clone the git off of sourceforge this morning,
> > and got an empty repo.  If there's a better place to clone from, let me
> > know and I'll fix it up for that.
> So, it turned out my initial attempt to keep the patch small had some
> limitations.  Working patch attached.
> To recap, the main problem is that I/O operations are blocking.  This is
> less important to local file or unix sockets, but can block the main
> nagios process when the I/O operations are tcp based.

This is an ancient discussion. The question is what do you do with the
events/results when you loose connection to whatever "logging
backend" (read local file or database). Just think disk is full and
icinga cora can not wirte any logs/results. Do you just discard all the
information or do you rather want to block/kill icinga core?
You can queue up a certain amount of protocols at different layers but
what do you do once all your buffers are exhausted?

Regards Chris

financial.com AG

Munich head office/Hauptsitz München: Maria-Probst-Str. 19 | 80939 München | Germany
Frankfurt branch office/Niederlassung Frankfurt: Messeturm | Friedrich-Ebert-Anlage 49 | 60327 Frankfurt | Germany
Management board/Vorstand: Dr. Steffen Boehnert | Dr. Alexis Eisenhofer | Dr. Yann Samson | Matthias Wiederwach
Supervisory board/Aufsichtsrat: Dr. Dr. Ernst zur Linden (chairman/Vorsitzender)
Register court/Handelsregister: Munich – HRB 128 972 | Sales tax ID number/St.Nr.: DE205 370 553

More information about the icinga-devel mailing list