Drain events before terminating log/thread managers.

Using the default scripts, the events from RemoteSerializer::LogStats()
were attempting to use the logging framework after logging/threading
had been terminated which never worked right and sometimes caused
crashes with "fatal error: cannot lock mutex".

Also made communication log baseline test pass more reliably.
This commit is contained in:
Jon Siwek 2012-06-28 12:42:32 -05:00
parent a651185ff9
commit 21a0e74d68
3 changed files with 23 additions and 17 deletions

View file

@ -5,7 +5,7 @@
# @TEST-EXEC: btest-bg-wait -k 10
#
# Don't diff the receiver log just because port is always going to change
# @TEST-EXEC: egrep -v 'pid|socket buffer size' sender/communication.log >send.log
# @TEST-EXEC: egrep -v 'CPU|bytes|pid|socket buffer size' sender/communication.log >send.log
# @TEST-EXEC: btest-diff send.log
@TEST-START-FILE sender.bro
@ -19,6 +19,10 @@ redef Communication::nodes += {
event remote_connection_handshake_done(p: event_peer)
{
terminate_communication();
}
event remote_connection_closed(p: event_peer)
{
terminate();
}
@ -30,9 +34,8 @@ event remote_connection_handshake_done(p: event_peer)
@load frameworks/communication/listen
event remote_connection_handshake_done(p: event_peer)
event remote_connection_closed(p: event_peer)
{
terminate_communication();
terminate();
}