- Oct 31, 2022
-
-
Nikolay Shirokovskiy authored
`say_logrotate` does not rotate logs synchronously. It posts tasks to coio which executes them in it's pool thread. On application exit we destroy logs calling `log_destroy`. This function waits for rotate task to finish because if it will free resources immediately then unfinished rotate task can have use-after-free issues. Waiting crashes because at this moment event loop is not running which is required for `fiber_cond_wait` to work. Note that if there is no crash then we will hang forever waiting in `log_destroy` because event loop is not running and `log_rotate_async_cb` will never be executed. Let's use mutexes and conditions instead. It solves both problems with crash and hang. Thanks Vladimir Davydov for idea. Fixes #4450 NO_DOC=bugfix (cherry picked from commit eed09192)
-
- Sep 12, 2022
-
-
Vladimir Davydov authored
strerror() is MT-Unsafe, because it uses a static buffer under the hood. We should use strerror_r() instead, which takes a user-provided buffer. The problem is there are two implementations of strerror_r(): XSI and GNU. The first one returns an error code and always writes the message to the beginning of the buffer while the second one returns a pointer to a location within the buffer where the message starts. Let's introduce a macro HAVE_STRERROR_R_GNU set if the GNU version is available and define tt_strerror() which writes the message to the static buffer, like tt_cstr() or tt_sprintf(). Note, we have to export tt_strerror(), because it is used by Lua via FFI. We also need to make it available in the module API header, because the say_syserror() macro uses strerror() directly. In order to avoid adding tt_strerror() to the module API, we introduce an internal helper function _say_strerror(), which calls tt_strerror(). NO_DOC=bug fix NO_TEST=code is covered by existing tests (cherry picked from commit 44f46dc8)
-
- Sep 22, 2018
-
-
Vladimir Davydov authored
There are a few tests that create files in the system tmp directory and don't delete them. This is contemptible - tests shouldn't leave any traced on the host. Fix those tests. Closes #3688
-
- Apr 05, 2018
-
-
Ilya Markov authored
* Remove rewriting format of default logger in case of syslog option. * Add facility option parsing and use parsed results in format message according to RFC3164. Possible values and default value of syslog facility are taken from nginx (https://nginx.ru/en/docs/syslog.html) * Move initialization of logger type and format fucntion before initialization of descriptor in log_XXX_init, so that we can test format function of syslog logger. Closes gh-3244.
-
- Mar 29, 2018
-
-
Ilya Markov authored
* Refactor tests. * Add ev_async and fiber_cond for thread-safe log_rotate usage. Follow up #3015
-
- Mar 20, 2018
-
-
Konstantin Belyavskiy authored
Under FreeBSD getline prototype is not provided by default due to compatibility problems. Get rid of getline (use fgets instead). Based on @locker proposal. Closes #3217.
-
- Mar 13, 2018
-
-
IlyaMarkovMipt authored
Current log rotation is not async signal safe. In order to make it so refactor signal handling with ev_signal. Log rotation for each logger performs in separate coio_task to provide async and thread-safe execution. Relates #3015
-
- Dec 21, 2017
-
-
Ilya authored
* Add check on NULL filename in format functions * The need of this fix was inspired by possible need of custom loggers which want to reuse our format functions
-
Ilya authored
* Add struct log * Add possibility to add logger configuration to global scope * Refactor functions in say to use them with specified config, not only global variable This patch was inspired by need of additional logger in audit log Relates #2912
-
Ilya authored
* Pull error processing from functions say_XXX_init(file, pipe, sys) to say_log_init * Remove error processing with passing point error message as an argument * Add new exception IllegalParameters
-
- Oct 12, 2017
-
-
Ilya authored
* Add log_format option to box.cfg{} * Add json format in logging * Add table converting to json in lua logging Closes #2795
-
Roman Tsisyk authored
Create a different type of logger for boot mode. In context of #2795
-
- Jan 10, 2017
-
-
Roman Tsisyk authored
Improves usability of `log` Lua module for scripting. Fixes #1876
-
- Nov 09, 2015
-
-
Nick Zavaritsky authored
-