log: free resources while event loop is running
The 'log' module uses fibers internally for logs rotation sake and before we can free log's resources (on program exit) we need to wait until rotation is complete, which implies that events loop is still running. But we break the event loop in `on_shutdown_f` trigger and calling any events based functionality later cause unexpected results because fibers are no loner valid to use. Thus move `say_logger_free` call into `on_shutdown_f` body where fibers are still alive. N.B. Testing the issue is sensitive to timings, during local tests found that minimal delay 1ms is enough to trigger, thus ERRINJ_LOG_ROTATE get increased. Fixes #4450 NO_DOC=bugfix Signed-off-by:Cyrill Gorcunov <gorcunov@gmail.com> (cherry picked from commit 0c3f9b37)
Showing
- changelogs/unreleased/gh-4450-logger-sigsegv.md 4 additions, 0 deletionschangelogs/unreleased/gh-4450-logger-sigsegv.md
- src/lib/core/say.c 15 additions, 2 deletionssrc/lib/core/say.c
- src/main.cc 1 addition, 1 deletionsrc/main.cc
- test/app-tap/gh-4450-log-rotate-exit.test.lua 46 additions, 0 deletionstest/app-tap/gh-4450-log-rotate-exit.test.lua
- test/app-tap/suite.ini 1 addition, 1 deletiontest/app-tap/suite.ini
Loading
Please register or sign in to comment