Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
2822e28b
Commit
2822e28b
authored
Jan 17, 2018
by
Leigh B Stoller
Browse files
Another tweak to keep the queue of incoming notifications drained.
parent
47bf3768
Changes
1
Show whitespace changes
Inline
Side-by-side
protogeni/event/igevent_daemon.in
View file @
2822e28b
...
...
@@ -168,7 +168,7 @@ $SIG{HUP} = \&handler
GeniUtil::
FlipToGeniUser
();
# We process a lot of events!
event_set_sockbufsizes
(
1024
*
64
,
1024
*
1
9
2
);
event_set_sockbufsizes
(
1024
*
128
,
1024
*
12
8
);
#
# Capture all events from the local pubsubd and transform them into
...
...
@@ -236,12 +236,25 @@ if (!event_subscribe($localhandle, \&callback, $tuple)) {
# Flag to know when there are no more events to process.
#
my
$gotone
;
my
@notifications
=
();
sub
callback
($$$)
{
my
(
$handle
,
$notification
,
$data
)
=
@_
;
$gotone
++
;
my
$clone
=
event_notification_clone
(
$handle
,
$notification
);
if
(
!
$clone
)
{
print
STDERR
"
Could not clone notification
\n
";
return
;
}
unshift
(
@notifications
,
$clone
);
}
sub
HandleNotification
($$)
{
my
(
$handle
,
$notification
)
=
@_
;
my
$site
=
event_notification_get_site
(
$handle
,
$notification
);
#
...
...
@@ -416,6 +429,11 @@ while (1)
$gotone
=
0
;
event_poll
(
$localhandle
);
}
while
(
@notifications
)
{
my
$notification
=
pop
(
@notifications
);
HandleNotification
(
$localhandle
,
$notification
);
event_notification_free
(
$localhandle
,
$notification
);
}
event_poll_blocking
(
$localhandle
,
1000
);
#
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment