This repository has been archived by the owner on Jan 15, 2019. It is now read-only.
[dev.icinga.com #8139] Add functions for registering file descriptors closed on fork() #1535
Labels
Milestone
This issue has been migrated from Redmine: https://dev.icinga.com/issues/8139
Created by jrhunt on 2014-12-24 21:31:42 +00:00
Assignee: jrhunt
Status: Resolved (closed on 2015-01-24 14:50:03 +00:00)
Target Version: 1.13
Last Update: 2015-02-15 01:11:30 +00:00 (in Redmine)
I have attached a patch that provides a new set of functions for registering file descriptors to be closed on fork().
First, a little history:
My team and I have developed a custom event broker module that understands NSCA wire protocol. After a few months in production, we noticed that our event broker would sometimes be unable to re-bind its TCP port after an Icinga restart. (Incidentally, I believe this may be the same behavior that is causing bug #5879). Upon further investigation, we determined that we had active checks taking upwards of 30s to run (failed SSH checks), and that each check would inherit the bound port from its parent, the main Icinga process.
Since there is no O_CLOEXEC analog for fork(), we opted to build a system whereby event brokers could register file descriptors in a central list, and the main Icinga thread would be diligent about closing those descriptors after every call to fork().
This is that patch.
Attachments
Changesets
2015-01-24 14:45:59 +00:00 by (unknown) 12ff996
2015-01-24 14:47:57 +00:00 by (unknown) 99f7339
The text was updated successfully, but these errors were encountered: