Commit 116539b6 authored by Leigh Stoller's avatar Leigh Stoller

Add EventFork() to event.pm (perl interface to event system) and to

the tail file of course. Called from TBdbfork() in libdb, EventFork
resets the event handle so that the child does a reconnect. Note that
I do not disconnect in the child since I have no idea what that is
going to do to the parents connection to the elvind, as Elvin makes no
mention of what to do in the presence of a process that forks after
connecting to the event server. At the least, this avoids a bunch of
warnings and errors from vnodesetup!
parent 4c27ad9c
......@@ -269,6 +269,9 @@ sub TBdbfork()
select(undef, undef, undef, 0.3);
undef($DB);
TBDBConnect();
if ($EVENTSYS) {
EventFork();
}
}
#
......
......@@ -840,6 +840,15 @@ sub EventSend(@) {
return 1;
}
#
# After a fork, undef the handle to the event system so that we form a
# a new connection in the child. Do not disconnect from the child; I have
# no idea what that will do to the parent connection.
#
sub EventFork() {
$event::EventSendHandle = undef;
}
#
# When we exit, unregister with the event system if we're connected
#
......@@ -852,6 +861,6 @@ END {
}
push @EXPORT, qw(event_subscribe event_poll event_poll_blocking EventSend
EventSendFatal EventSendWarn);
EventSendFatal EventSendWarn EventFork);
1;
......@@ -193,6 +193,15 @@ sub EventSend(@) {
return 1;
}
#
# After a fork, undef the handle to the event system so that we form a
# a new connection in the child. Do not disconnect from the child; I have
# no idea what that will do to the parent connection.
#
sub EventFork() {
$event::EventSendHandle = undef;
}
#
# When we exit, unregister with the event system if we're connected
#
......@@ -205,6 +214,6 @@ END {
}
push @EXPORT, qw(event_subscribe event_poll event_poll_blocking EventSend
EventSendFatal EventSendWarn);
EventSendFatal EventSendWarn EventFork);
1;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment