broctly deploy hangs on checking scripts

If I have bro running and try a broctl deploy, it hangs on checking scripts. I have confirmed there are no files owned by a user other than the one running bro. If I stop bro first, do an install, then do a check, it does it very fast and cleanly.

I used to see that occasionally when the manager was extremely heavily loaded... but it's been a while (I thought Daniel fixed it?). It was some sort of race condition in the command/script that check runs that causes it to not exit.

all the check script itself does is start bro with

event bro_init() &priority=-10
  {
  terminate_communication();
  }

Are you still seeing this on 2.5?

Yes, seeing this in 2.5.

If you have exit_only_after_terminate set, usually for debugging, we’ve had that hang the ‘bro check’.

-Dop

Yeah, that would do it.. but it would break like that 100% of the time, not only when bro was running.

Daniel, do you remember why we use terminate_communication() instead of exit_only_after_terminate + terminate() ?

I vaguely remember something about terminate_communication being misused somewhere else that had issues with the switch to broker.

Does this happen every time, or only sometimes?

Some times. I can’t seem to get a consistently repeatable behavior. When it does happen though, no matter how many times I kill the broctl attempt and rerun deploy, it won’t check. I have to issue a stop first.

OK, would you be willing to try the attached patch?
I'd like to know if it prevents "broctl deploy" (or "broctl check")
from hanging.

To apply the patch, you don't need to re-install Bro,
you can just patch the installed copy (replace $PREFIX
with your Bro install prefix directory, such as /usr/local/bro):
cd $PREFIX
patch -p0 -b < check.patch

check.patch (503 Bytes)

I will try to get this applied this morning and will get back to you.