forked from tarantool/tarantool
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lua: fix crash on running in background mode
Tarantool with background mode enabled in environment variable could lead a crash: NO_WRAP ``` $ TT_PID_FILE=tarantool.pid TT_LOG=tarantool.log TT_BACKGROUND=true TT_LISTEN=3301 tarantool -e 'box.cfg{}' $ tail -3 tarantool.log 2021-11-02 16:05:43.672 [2341202] main init.c:696 E> LuajitError: cannot read stdin: Resource temporarily unavailable 2021-11-02 16:05:43.672 [2341202] main F> fatal error, exiting the event loop 2021-11-02 16:05:43.672 [2341202] main F> fatal error, exiting the event loop Patch fixes a crash. Other testcases were tested too: $ TT_PID_FILE=tarantool.pid TT_LOG=tarantool.log TT_BACKGROUND=true TT_LISTEN=3301 ./build/src/tarantool < box.cfg.lua $ echo "box.cfg{}" | TT_PID_FILE=tarantool.pid TT_LOG=tarantool.log TT_BACKGROUND=true TT_LISTEN=3301 ./build/src/tarantool - $ ./build/src/tarantool -l fiber -e 'fiber.sleep(1) box.cfg{background=true, log="tarantool.log", pid_file="tarantool.pid"}' (T="$(realpath ./build/src/tarantool)"; I=$(realpath third_party/luajit/test/luajit-test-init.lua); cd third_party/luajit/test/lua-Harness-tests; export LUA_PATH="$(realpath .)/?.lua;;"; "${T}" -e "dofile[[${I}]]" -l profile_tarantool 241-standalone.t) ``` NO_WRAP I dig a bit to a Git history and found that case with TT_BACKGROUND=true never worked: - commit 1b33012 ("box: set box.cfg options via environment variables") - commit 9db64ae ("lua: add '-' command line option") Closes tarantool#6128 NO_DOC=bugfix
- Loading branch information
Showing
7 changed files
with
126 additions
and
12 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
changelogs/unreleased/gh-6128-fix-crash-with-background-env-option.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## bugfix/core | ||
|
||
* Fixed a crash that could happen when Tarantool is started with environment | ||
variable `TT_BACKGROUND=true` (gh-6128). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters