mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 05:58:20 +00:00
Actually check if the number of fields in a write are equal to the
number of fields required. Addresses BIT-1683 I do not think this quite fixes the underlying issue of BIT-1683 - it should not be possible to get to this state in normal operations. Also fixes a small memory leak for disabled writers.
This commit is contained in:
parent
0bc4a5ea52
commit
038dfa6273
6 changed files with 144 additions and 4 deletions
|
@ -0,0 +1,49 @@
|
|||
# @TEST-SERIALIZE: comm
|
||||
#
|
||||
# @TEST-EXEC: btest-bg-run manager-1 "cp ../cluster-layout.bro . && CLUSTER_NODE=manager-1 bro %INPUT"
|
||||
# @TEST-EXEC: sleep 1
|
||||
# @TEST-EXEC: btest-bg-run worker-1 "cp ../cluster-layout.bro . && CLUSTER_NODE=worker-1 bro --pseudo-realtime -C -r $TRACES/wikipedia.trace %INPUT"
|
||||
# @TEST-EXEC: btest-bg-wait 20
|
||||
# @TEST-EXEC: btest-diff manager-1/reporter.log
|
||||
|
||||
|
||||
@TEST-START-FILE cluster-layout.bro
|
||||
redef Cluster::nodes = {
|
||||
["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp, $workers=set("worker-1")],
|
||||
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"],
|
||||
};
|
||||
@TEST-END-FILE
|
||||
|
||||
redef Log::default_rotation_interval = 0secs;
|
||||
|
||||
@load base/protocols/conn
|
||||
|
||||
redef Log::default_scope_sep="_";
|
||||
|
||||
type Extension: record {
|
||||
write_ts: time &log;
|
||||
stream: string &log;
|
||||
system_name: string &log;
|
||||
};
|
||||
|
||||
@if ( Cluster::local_node_type() == Cluster::MANAGER )
|
||||
|
||||
function add_extension(path: string): Extension
|
||||
{
|
||||
return Extension($write_ts = network_time(),
|
||||
$stream = path,
|
||||
$system_name = peer_description);
|
||||
}
|
||||
|
||||
redef Log::default_ext_func = add_extension;
|
||||
|
||||
@endif
|
||||
|
||||
event terminate_me() {
|
||||
terminate();
|
||||
}
|
||||
|
||||
event remote_connection_closed(p: event_peer) {
|
||||
schedule 1sec { terminate_me() };
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
# @TEST-SERIALIZE: comm
|
||||
#
|
||||
# @TEST-EXEC: btest-bg-run manager-1 "cp ../cluster-layout.bro . && CLUSTER_NODE=manager-1 bro %INPUT"
|
||||
# @TEST-EXEC: sleep 1
|
||||
# @TEST-EXEC: btest-bg-run worker-1 "cp ../cluster-layout.bro . && CLUSTER_NODE=worker-1 bro --pseudo-realtime -C -r $TRACES/wikipedia.trace %INPUT"
|
||||
# @TEST-EXEC: btest-bg-wait 20
|
||||
# @TEST-EXEC: btest-diff manager-1/http.log
|
||||
|
||||
|
||||
@TEST-START-FILE cluster-layout.bro
|
||||
redef Cluster::nodes = {
|
||||
["manager-1"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=37757/tcp, $workers=set("worker-1")],
|
||||
["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=37760/tcp, $manager="manager-1", $interface="eth0"],
|
||||
};
|
||||
@TEST-END-FILE
|
||||
|
||||
redef Log::default_rotation_interval = 0secs;
|
||||
|
||||
@load base/protocols/conn
|
||||
|
||||
redef Log::default_scope_sep="_";
|
||||
|
||||
type Extension: record {
|
||||
write_ts: time &log;
|
||||
stream: string &log;
|
||||
system_name: string &log;
|
||||
};
|
||||
|
||||
function add_extension(path: string): Extension
|
||||
{
|
||||
return Extension($write_ts = network_time(),
|
||||
$stream = path,
|
||||
$system_name = peer_description);
|
||||
}
|
||||
|
||||
redef Log::default_ext_func = add_extension;
|
||||
|
||||
event terminate_me() {
|
||||
terminate();
|
||||
}
|
||||
|
||||
event remote_connection_closed(p: event_peer) {
|
||||
schedule 1sec { terminate_me() };
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue