Reconfiguration of a running node
Some of the configuration options for a node is static, in the meaning that they are long living and normally not changing during the life time of a log instance. Examples are the Trillian tree ID (tree-id
) and the log key (key
).
Other options are expected to change more often, for tweaking certain attributes of the log or for doing diagnostics and debugging. Examples are timeout
, interval
and log-level
.
Especially for a node in a busy or large log instance, it would be good to not have to restart a node in order to change some config parameters, in particular the ones listed in the previous paragraph.
Two examples of when reconfiguration of a running node could be valuable:
- If a node takes a considerable amount of time to start, for reading the db or building the tree, that is time when it is unavailable.
- When hunting down a bug, one might need debug printouts enabled without destroying the current state of the program by restarting.
-
Re-reading the config file when SIGHUP is received would be one option. Internally marking which config options need a restart and which do not would make it possible to 1) update those who can be changed while running and 2) log a warning (or error) for those who need a restart.
-
Changing the log level to debug when receiving SIGUSR1 and changing log level to what's in the config file when receiving SIGUSR2 would be valuable regardless of 1 above.