# topic/seth/metrics-merge crash

**URL:** <https://community.zeek.org/t/topic-seth-metrics-merge-crash/2498>\
**Category:** Development\
**Tags:** development\
**Created:** [November 20, 2012, 4:21pm UTC](https://community.zeek.org/t/topic-seth-metrics-merge-crash/2498 "2012-11-20T16:21:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seth\_Hall3](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@Seth\_Hall3](https://community.zeek.org/u/Seth_Hall3)\
**Post date:** [November 20, 2012, 4:21pm UTC](https://community.zeek.org/t/topic-seth-metrics-merge-crash/2498/1 "2012-11-20T16:21:33Z")

</div>

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!  
&nbsp;&nbsp;.Seth

---

<div class="post-metadata">

**Author:** ![Siwek\_Jon](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@Siwek\_Jon](https://community.zeek.org/u/Siwek_Jon)\
**Post date:** [November 26, 2012, 6:11pm UTC](https://community.zeek.org/t/topic-seth-metrics-merge-crash/2498/2 "2012-11-26T18:11:20Z")

</div>

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  
&nbsp;&nbsp;&nbsp;&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;#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;

---

<div class="post-metadata">

**Author:** ![Seth\_Hall3](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@Seth\_Hall3](https://community.zeek.org/u/Seth_Hall3)\
**Post date:** [November 26, 2012, 9:11pm UTC](https://community.zeek.org/t/topic-seth-metrics-merge-crash/2498/3 "2012-11-26T21:11:33Z")

</div>

> > 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.

> &nbsp;&nbsp;&nbsp;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. 🙂

&nbsp;&nbsp;.Seth

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:40pm UTC](https://community.zeek.org/t/topic-seth-metrics-merge-crash/2498/4 "2022-05-06T15:40:40Z")

</div>


