mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Merge remote-tracking branch 'jgras/topic/jgras/cluster-active-node-count-fix'
* jgras/topic/jgras/cluster-active-node-count-fix: Fix get_active_node_count for node types not present. Changed over to explicit existence check instead to avoid the set() creation upon missed lookups.
This commit is contained in:
commit
c2a07476cc
3 changed files with 8 additions and 4 deletions
4
CHANGES
4
CHANGES
|
@ -1,3 +1,7 @@
|
|||
6.0.0-dev.595 | 2023-05-17 10:36:22 +0200
|
||||
|
||||
* Fix get_active_node_count for node types not present. (Jan Grashoefer, Corelight)
|
||||
|
||||
6.0.0-dev.592 | 2023-05-17 09:02:09 +0200
|
||||
|
||||
* zeekygen: Render function parameters as :param x: instead of :x: (Arne Welzel, Corelight)
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
6.0.0-dev.592
|
||||
6.0.0-dev.595
|
||||
|
|
|
@ -318,7 +318,7 @@ function Cluster::get_node_count(node_type: NodeType): count
|
|||
|
||||
function Cluster::get_active_node_count(node_type: NodeType): count
|
||||
{
|
||||
return |active_node_ids[node_type]|;
|
||||
return node_type in active_node_ids ? |active_node_ids[node_type]| : 0;
|
||||
}
|
||||
|
||||
function is_enabled(): bool
|
||||
|
@ -377,7 +377,7 @@ event Cluster::hello(name: string, id: string) &priority=10
|
|||
|
||||
@pragma push ignore-deprecations
|
||||
if ( n$node_type == WORKER )
|
||||
worker_count = |active_node_ids[WORKER]|;
|
||||
worker_count = get_active_node_count(WORKER);
|
||||
@pragma pop ignore-deprecations
|
||||
}
|
||||
|
||||
|
@ -402,7 +402,7 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string) &priority=1
|
|||
|
||||
@pragma push ignore-deprecations
|
||||
if ( n$node_type == WORKER )
|
||||
worker_count = |active_node_ids[WORKER]|;
|
||||
worker_count = get_active_node_count(WORKER);
|
||||
@pragma pop ignore-deprecations
|
||||
|
||||
event Cluster::node_down(node_name, endpoint$id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue