mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
event: Reinitialize EventMgr's flare after fork() from stem
Because EventMgr is defined globally as an object (rather than a global pointer to an EventMgr object), its pipe is created even before main() is entered. This further means that in the fork-based supervisor setup, all Zeek processes created from the top-level supervisor process share the same pipe object for the EventMgr. In turn, whenever any of the processes enqueued an event, the flare was fired and ready for reading on all other processes in the cluster, causing much contention and unneeded overhead. Closes #3190
This commit is contained in:
parent
16a51218a5
commit
d8a0822221
3 changed files with 17 additions and 0 deletions
|
@ -554,8 +554,14 @@ SetupResult setup(int argc, char** argv, Options* zopts)
|
|||
auto stem = Supervisor::CreateStem(options.supervisor_mode);
|
||||
|
||||
if ( Supervisor::ThisNode() )
|
||||
{
|
||||
// If we get here, we're a supervised node that just returned
|
||||
// from CreateStem() after being forked from the stem.
|
||||
Supervisor::ThisNode()->Init(&options);
|
||||
|
||||
event_mgr.InitPostFork();
|
||||
}
|
||||
|
||||
script_coverage_mgr.ReadStats();
|
||||
|
||||
auto dns_type = options.dns_mode;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue