topic/seth/metrics-merge crash

I'm seeing Bro actually crash for the scripts.base.frameworks.metrics.cluster-intermediate-update test and I'm having a hard time figuring out why it's crashing. Would someone mind taking a look at that soon?

Thanks!
  .Seth

See if the patch below makes sense. Also not sure if that index_requests table is missing some initialization somewhere.

diff --git a/scripts/base/frameworks/metrics/cluster.bro b/scripts/base/frameworks/metrics/cluster.bro
index 9650b80..d23b9cd 100644
--- a/scripts/base/frameworks/metrics/cluster.bro
+++ b/scripts/base/frameworks/metrics/cluster.bro
@@ -190,7 +190,12 @@ event Metrics::cluster_index_response(uid: string, id: string, filter_name: stri
    {
    #print fmt("%0.6f MANAGER: receiving index data from %s - %s=%s", network_time(), get_event_peer()$descr, index2str(index), val);

- local merged_val = merge_result_vals(index_requests[uid, id, filter_name, index], val);
+ local merged_val: ResultVal;

I'm seeing Bro actually crash for the scripts.base.frameworks.metrics.cluster-intermediate-update test and I'm having a hard time figuring out why it's crashing. Would someone mind taking a look at that soon?

See if the patch below makes sense. Also not sure if that index_requests table is missing some initialization somewhere.

Ah! Thanks. I bet you're right about this. I'll test it tonight.

   local ir = index_requests[uid, id, filter_name, index];

And as an optimization, maybe that "local ir" isn't needed since that index was just assigned in the line above?

The ir is actually an optimization so that I don't have to keep indexing into that table over and over later in the event handler. It's even possible that I only need to do that assignment when the first value comes in anyway. I'll play around with that more tonight too.

Thanks for helping me out. :slight_smile:

  .Seth