[tarantool-patches] [PATCH 0/1] Fixed non-informative error messages for log conf

Olga Arkhangelskaia arkholga at tarantool.org
Mon Jul 30 16:58:00 MSK 2018


Tarantool log used to have more serious problems than non-informative messages:
No check on parameters like log_nonblock, log_format in case of unconfigured log.
This means that there was a possibility to set any value in case when the
first log conf. commands were: 
box.cfg{log_format = ‘any’}
box.cfg{log_nonblock=true} - (together with stderr)
In case of log_format  with such scenario additional problem took place.
When setting log format we change format_func
(function that actually logs to log) to NULL, and wrong log_format
lead to crash - because we could not log error with log format because of 
format_func was not set yet, but already had been changed to null.
In case of undefined log type  (“log=’:test:’:) we used to have empty
exception - so,tarantool just silently crashed.
I think the main problem that initial initialization is mixed up with
configuring parameters.  So if we decide to refactor log we need to separate
them. For example, have set of checking functions and set of configuring.
One parameter - one check.
End initial initialization should use the same way prior setting any parameter.

Patch fixes this problems using the easiest way, however if in future we need
some more parameters - we should consider the idea of refactor.
 
Olga Arkhangelskaia (1):
  Fixed non-informative error messages for log conf.

 src/box/box.cc            | 25 ++++++++++++++++++-------
 src/say.c                 | 22 +++++++++++++++-------
 src/say.h                 |  4 +++-
 test/box-tap/cfg.test.lua |  2 +-
 4 files changed, 37 insertions(+), 16 deletions(-)

-- 
2.14.3 (Apple Git-98)





More information about the Tarantool-patches mailing list