option.bif: Short-circuit option changes when terminating

Due to the asynchronous behavior of the input framework and broker
communication, change handlers were previously called even after
zeek_done() event processing completed and also broker shutdown.

Accessing broker store handles within change handlers this late
triggered invalid Broker store handle messages:

    error in ././my_option_store.zeek, line 13: invalid Broker store handle (Broker::put(Test::store, to_any_coercemy_option, to_any_coerceTest::new_value, 0 secs) and broker::store::{})

Fixes #2010
This commit is contained in:
Arne Welzel 2022-07-25 17:41:12 +02:00
parent 28081d1efa
commit 11cde53373
4 changed files with 45 additions and 0 deletions

4
NEWS
View file

@ -41,6 +41,10 @@ Changed Functionality
- The default logging directory is now set globally across all log
writers through ``Log::default_logdir``.
- Calling `Option::set()` when Zeek is terminating is now a noop and returns `F`.
This prevents callbacks into script-land through change handlers when parts
of the environment have already been torn down.
Deprecated Functionality
------------------------