Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background start of Tarantool fails with LuajitError: cannot read stdin #6128

Closed
ochaton opened this issue Jun 6, 2021 · 6 comments · Fixed by #7485
Closed

Background start of Tarantool fails with LuajitError: cannot read stdin #6128

ochaton opened this issue Jun 6, 2021 · 6 comments · Fixed by #7485
Assignees
Labels
2.10 Target is 2.10 and all newer release/master branches bug Something isn't working

Comments

@ochaton
Copy link
Member

ochaton commented Jun 6, 2021

Bug description

  • OS: MacOS
  • Tarantool 2.8.1-39-g77c0af501

Reproducer

TT_PID_FILE=tarantool.pid TT_LOG=tarantool.log TT_BACKGROUND=true TT_LISTEN=3000 ~/tarantool/2.8.1/bin/tarantool -e 'box.cfg{}'

cat tarantool.log
2021-06-06 10:31:39.173 [96924] main/103/interactive C> Tarantool 2.8.1-39-g77c0af501
2021-06-06 10:31:39.174 [96924] main/103/interactive C> log level 5
2021-06-06 10:31:39.174 [96924] main/103/interactive I> wal/engine cleanup is paused
2021-06-06 10:31:39.175 [96924] main/103/interactive I> mapping 268435456 bytes for memtx tuple arena...
2021-06-06 10:31:39.175 [96924] main/103/interactive I> Actual slab_alloc_factor calculated on the basis of desired slab_alloc_factor = 1.044274
2021-06-06 10:31:39.175 [96924] main/103/interactive I> mapping 134217728 bytes for vinyl tuple arena...
2021-06-06 10:31:39.183 [96924] main/103/interactive I> instance uuid dc94ea40-792d-4a98-aa00-8a18981ca183
2021-06-06 10:31:39.185 [96924] main/103/interactive I> : bound to [::]:3000
2021-06-06 10:31:39.185 [96924] main/103/interactive I> initializing an empty data directory
2021-06-06 10:31:39.215 [96924] main/103/interactive I> assigned id 1 to replica dc94ea40-792d-4a98-aa00-8a18981ca183
2021-06-06 10:31:39.215 [96924] main/103/interactive I> cluster uuid f34a5b7e-1e50-4b9e-9d93-03b4097f04eb
2021-06-06 10:31:39.217 [96924] snapshot/101/main I> saving snapshot `./00000000000000000000.snap.inprogress'
2021-06-06 10:31:39.218 [96924] snapshot/101/main I> done
2021-06-06 10:31:39.219 [96924] main/103/interactive I> ready to accept requests
2021-06-06 10:31:39.219 [96924] main/104/gc I> wal/engine cleanup is resumed
2021-06-06 10:31:39.219 [96924] main/103/interactive I> set 'log_level' configuration option to 5
2021-06-06 10:31:39.219 [96924] main/105/checkpoint_daemon I> scheduled next checkpoint for Sun Jun  6 11:36:08 2021
2021-06-06 10:31:39.219 [96924] main/103/interactive I> set 'listen' configuration option to "3000"
2021-06-06 10:31:39.219 [96924] main/103/interactive I> set 'log_format' configuration option to "plain"
2021-06-06 10:31:39.220 [96924] main init.c:694 E> LuajitError: cannot read stdin: Resource temporarily unavailable
2021-06-06 10:31:39.220 [96924] main F> fatal error, exiting the event loop
2021-06-06 10:31:39.220 [96924] main F> fatal error, exiting the event loop
@ochaton ochaton added the bug Something isn't working label Jun 6, 2021
@kyukhin kyukhin added tmp teamE and removed tmp labels Jul 14, 2021
@ligurio
Copy link
Member

ligurio commented Aug 3, 2021

Bug can be reproduced without environment variables:
./src/tarantool -e 'box.cfg{pid_file="tarantool.pid", background=true, log="tarantool.log"}'
and seems bug was introduced many time ago, it exists in 9fba29a (~ v2.2.0)

@Totktonada
Copy link
Member

Hit the same on 1.10.8-45-gaa8f685.

@ochaton
Copy link
Member Author

ochaton commented Sep 7, 2021

@Totktonada will we fix this ?

@ligurio ligurio self-assigned this Oct 21, 2021
@Totktonada
Copy link
Member

@ochaton We'll do.

@ligurio
Copy link
Member

ligurio commented Nov 2, 2021

Hit the same on 1.10.8-45-gaa8f685.

Builds with commits 1b33012 ('box: set box.cfg options via environment variables') and 9db64ae ('lua: add '-' command line option').

ligurio added a commit that referenced this issue Nov 2, 2021
$ 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
$

commit 1b33012 (origin/gh-5999)
Author: Roman Khabibov <roman.habibov@tarantool.org>
Date:   Tue Mar 9 16:47:11 2021 +0300

    box: set box.cfg options via environment variables

commit 9db64ae
Author: Roman Tsisyk <roman@tarantool.org>
Date:   Thu Aug 17 16:59:16 2017 +0300

    lua: add '-' command line option

Closes #6128
@Totktonada Totktonada removed the teamE label May 27, 2022
@kyukhin kyukhin removed the teamC label Jul 5, 2022
ligurio added a commit to ligurio/tarantool that referenced this issue Jul 27, 2022
$ 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
$

commit 1b33012 (origin/tarantoolgh-5999)
Author: Roman Khabibov <roman.habibov@tarantool.org>
Date:   Tue Mar 9 16:47:11 2021 +0300

    box: set box.cfg options via environment variables

commit 9db64ae
Author: Roman Tsisyk <roman@tarantool.org>
Date:   Thu Aug 17 16:59:16 2017 +0300

    lua: add '-' command line option

Closes tarantool#6128
ligurio added a commit to ligurio/tarantool that referenced this issue Jul 27, 2022
$ 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
$

commit 1b33012 (origin/tarantoolgh-5999)
Author: Roman Khabibov <roman.habibov@tarantool.org>
Date:   Tue Mar 9 16:47:11 2021 +0300

    box: set box.cfg options via environment variables

commit 9db64ae
Author: Roman Tsisyk <roman@tarantool.org>
Date:   Thu Aug 17 16:59:16 2017 +0300

    lua: add '-' command line option

Closes tarantool#6128
ligurio added a commit to ligurio/tarantool that referenced this issue Jul 27, 2022
$ 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
$

commit 1b33012 (origin/tarantoolgh-5999)
Author: Roman Khabibov <roman.habibov@tarantool.org>
Date:   Tue Mar 9 16:47:11 2021 +0300

    box: set box.cfg options via environment variables

commit 9db64ae
Author: Roman Tsisyk <roman@tarantool.org>
Date:   Thu Aug 17 16:59:16 2017 +0300

    lua: add '-' command line option

Closes tarantool#6128

NO_DOC=bugfix
ligurio added a commit to ligurio/tarantool that referenced this issue Jul 27, 2022
$ 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
$

'commit 1b33012 ("box: set box.cfg options via environment variables")'
'commit 9db64ae ("lua: add '-' command line option")'

Closes tarantool#6128

NO_DOC=bugfix
ligurio added a commit to ligurio/tarantool that referenced this issue Aug 1, 2022
$ 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
$

'commit 1b33012 ("box: set box.cfg options via environment variables")'
'commit 9db64ae ("lua: add '-' command line option")'

Closes tarantool#6128

NO_DOC=bugfix
@igormunkin igormunkin removed the teamL label Sep 15, 2022
ligurio added a commit to ligurio/tarantool that referenced this issue Oct 25, 2022
$ 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
$

'commit 1b33012 ("box: set box.cfg options via environment variables")'
'commit 9db64ae ("lua: add '-' command line option")'

Closes tarantool#6128

NO_DOC=bugfix
ligurio added a commit to ligurio/tarantool that referenced this issue Oct 25, 2022
$ 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
$

'commit 1b33012 ("box: set box.cfg options via environment variables")'
'commit 9db64ae ("lua: add '-' command line option")'

Closes tarantool#6128

NO_DOC=bugfix
ligurio added a commit to ligurio/tarantool that referenced this issue Oct 26, 2022
$ 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
$

$ ./build/src/tarantool -l fiber -e 'fiber.sleep(1) box.cfg{background=true, log="tarantool.log", pid_file="tarantool.pid"}'

'commit 1b33012 ("box: set box.cfg options via environment variables")'
'commit 9db64ae ("lua: add '-' command line option")'

(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)

Closes tarantool#6128

NO_DOC=bugfix
ligurio added a commit to ligurio/tarantool that referenced this issue Oct 26, 2022
$ 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
$

$ 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"}'

'commit 1b33012 ("box: set box.cfg options via environment variables")'
'commit 9db64ae ("lua: add '-' command line option")'

(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)

Closes tarantool#6128

NO_DOC=bugfix
ligurio added a commit to ligurio/tarantool that referenced this issue Oct 26, 2022
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.

$ 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

commit 1b33012 ("box: set box.cfg options via environment variables")
commit 9db64ae ("lua: add '-' command line option")

Closes tarantool#6128

NO_DOC=bugfix
ligurio added a commit to ligurio/tarantool that referenced this issue Oct 28, 2022
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
ligurio added a commit to ligurio/tarantool that referenced this issue Nov 3, 2022
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
ligurio added a commit to ligurio/tarantool that referenced this issue Nov 3, 2022
NO_CHANGELOG=internal
NO_DOC=internal
NO_TEST=internal

Needed for tarantool#6128
igormunkin pushed a commit that referenced this issue Jun 22, 2023
Before a commit ec1af12 ("box: do not close xlog file descriptors in
the atfork handler") there was a bug when Tarantool with enabled
background mode via 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
```
NO_WRAP

With commit ec1af12 ("box: do not close xlog file descriptors in
the atfork handler") described bug could not be reproduced.

Proposed patch adds a test that starts Tarantool in background mode
enabled via box.cfg option and via environment variable TT_BACKGROUND to
make sure this behaviour will not be broken in a future.

Closes #6128

NO_DOC=test
igormunkin pushed a commit that referenced this issue Jun 22, 2023
Before a commit ec1af12 ("box: do not close xlog file descriptors in
the atfork handler") there was a bug when Tarantool with enabled
background mode via 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
```
NO_WRAP

With commit ec1af12 ("box: do not close xlog file descriptors in
the atfork handler") described bug could not be reproduced.

Proposed patch adds a test that starts Tarantool in background mode
enabled via box.cfg option and via environment variable TT_BACKGROUND to
make sure this behaviour will not be broken in a future.

Closes #6128

NO_DOC=test

(cherry picked from commit f676fb7)
igormunkin pushed a commit that referenced this issue Jun 22, 2023
Before a commit ec1af12 ("box: do not close xlog file descriptors in
the atfork handler") there was a bug when Tarantool with enabled
background mode via 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
```
NO_WRAP

With commit ec1af12 ("box: do not close xlog file descriptors in
the atfork handler") described bug could not be reproduced.

Proposed patch adds a test that starts Tarantool in background mode
enabled via box.cfg option and via environment variable TT_BACKGROUND to
make sure this behaviour will not be broken in a future.

Closes #6128

NO_DOC=test

(cherry picked from commit f676fb7)
@igormunkin igormunkin added the 2.10 Target is 2.10 and all newer release/master branches label Jun 22, 2023
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Jun 29, 2023
Followup to tarantool#6128

NO_DOC=test fix
NO_CHANGELOG=test fix
ligurio added a commit to ligurio/tarantool that referenced this issue Jul 3, 2023
Previous attempt to fix flakiness in commit 6a2c73f ("test: fix
flakiness in gh_6128_background_mode_test") used a constant buffer size
in check_err_msg function. Tarantool 2.10 has a bit bigger log before a
desired message that other versions of Tarantool and it leads to a this
resulted in a truncated message ("entering the even" instead of
"entering the event loop"). Patch replaces check_err_msg()
implementation to grep_log used in luatest, it reads the whole log.

Also patch renames check_err_msg to check_msg, because "entering the
event loop" is not an error message.

Follows up tarantool#6128

NO_CHANGELOG=fix test
NO_DOC=fix test
ligurio added a commit to ligurio/tarantool that referenced this issue Jul 3, 2023
Previous attempt to fix flakiness in commit 6a2c73f ("test: fix
flakiness in gh_6128_background_mode_test") used a constant buffer size
in check_err_msg function. Tarantool 2.10 has a bit bigger log before a
desired message that other versions of Tarantool and it leads to a this
resulted in a truncated message ("entering the even" instead of
"entering the event loop"). Patch replaces check_err_msg()
implementation to grep_log used in luatest, it reads the whole log.

Also patch renames check_err_msg to check_msg, because "entering the
event loop" is not an error message.

Follows up tarantool#6128

NO_CHANGELOG=fix test
NO_DOC=fix test
ligurio added a commit to ligurio/tarantool that referenced this issue Jul 3, 2023
Previous attempt to fix flakiness in commit 6a2c73f ("test: fix
flakiness in gh_6128_background_mode_test") used a constant buffer size
in check_err_msg function. Tarantool 2.10 has a bit bigger log before a
desired message that other versions of Tarantool and it leads to a this
resulted in a truncated message ("entering the even" instead of
"entering the event loop"). Patch replaces check_err_msg()
implementation to grep_log used in luatest, it reads the whole log.

Also patch renames check_err_msg to check_msg, because "entering the
event loop" is not an error message.

Follows up tarantool#6128

NO_CHANGELOG=fix test
NO_DOC=fix test
ligurio added a commit to ligurio/tarantool that referenced this issue Jul 3, 2023
Previous attempt to fix flakiness in commit 6a2c73f ("test: fix
flakiness in gh_6128_background_mode_test") used a constant buffer size
in check_err_msg function. Tarantool 2.10 has a bit bigger log before a
desired message that other versions of Tarantool and it leads to a this
resulted in a truncated message ("entering the even" instead of
"entering the event loop"). Patch replaces check_err_msg()
implementation to grep_log used in luatest, it reads the whole log.

Also patch renames check_err_msg to check_msg, because "entering the
event loop" is not an error message.

Follows up tarantool#6128

NO_CHANGELOG=fix test
NO_DOC=fix test
igormunkin pushed a commit that referenced this issue Jul 4, 2023
Previous attempt to fix flakiness in commit 6a2c73f ("test: fix
flakiness in gh_6128_background_mode_test") used a constant buffer size
in check_err_msg function. Tarantool 2.10 has a bit bigger log before a
desired message that other versions of Tarantool and it leads to a this
resulted in a truncated message ("entering the even" instead of
"entering the event loop"). Patch replaces check_err_msg()
implementation to grep_log used in luatest, it reads the whole log.

Also patch renames check_err_msg to check_msg, because "entering the
event loop" is not an error message.

Follows up #6128

NO_CHANGELOG=fix test
NO_DOC=fix test
igormunkin pushed a commit to igormunkin/tarantool that referenced this issue Jul 4, 2023
Previous attempt to fix flakiness in commit 6a2c73f ("test: fix
flakiness in gh_6128_background_mode_test") used a constant buffer size
in check_err_msg function. Tarantool 2.10 has a bit bigger log before a
desired message that other versions of Tarantool and it leads to a this
resulted in a truncated message ("entering the even" instead of
"entering the event loop"). Patch replaces check_err_msg()
implementation to grep_log used in luatest, it reads the whole log.

Also patch renames check_err_msg to check_msg, because "entering the
event loop" is not an error message.

Follows up tarantool#6128

NO_CHANGELOG=fix test
NO_DOC=fix test

(cherry picked from commit 1c8e712)
igormunkin pushed a commit to igormunkin/tarantool that referenced this issue Jul 4, 2023
Previous attempt to fix flakiness in commit 6a2c73f ("test: fix
flakiness in gh_6128_background_mode_test") used a constant buffer size
in check_err_msg function. Tarantool 2.10 has a bit bigger log before a
desired message that other versions of Tarantool and it leads to a this
resulted in a truncated message ("entering the even" instead of
"entering the event loop"). Patch replaces check_err_msg()
implementation to grep_log used in luatest, it reads the whole log.

Also patch renames check_err_msg to check_msg, because "entering the
event loop" is not an error message.

Follows up tarantool#6128

NO_CHANGELOG=fix test
NO_DOC=fix test

(cherry picked from commit 1c8e712)
ligurio added a commit to ligurio/tarantool that referenced this issue Jul 4, 2023
Test uses a popen module that starts tarantool process in background
mode. Tarantool process started in background mode forks a new process
and closes a parent, after that popen losts a PID of the started process
and `ph:kill()` and `ph:terminate()` doesn't work anymore. It leads to
non-terminated tarantool processes after running the test.

Patch fixes that by running `kill` using os.execute with a PID of
tarantool process written to a pid file.

Follows up tarantool#6128

NO_CHANGELOG=fix test
NO_DOC=fix test
ligurio added a commit to ligurio/tarantool that referenced this issue Jul 4, 2023
Test uses a popen module that starts tarantool process in background
mode. Tarantool process started in background mode forks a new process
and closes a parent, after that popen losts a PID of the started process
and `ph:kill()` and `ph:terminate()` doesn't work anymore. It leads to
non-terminated tarantool processes after running the test.

Patch fixes that by running `kill` using os.execute with a PID of
tarantool process written to a pid file.

Follows up tarantool#6128

NO_CHANGELOG=fix test
NO_DOC=fix test
ligurio added a commit to ligurio/tarantool that referenced this issue Jul 4, 2023
Test uses a popen module that starts tarantool process in background
mode. Tarantool process started in background mode forks a new process
and closes a parent, after that popen losts a PID of the started process
and `ph:kill()` and `ph:terminate()` doesn't work anymore. It leads to
non-terminated tarantool processes after running the test.

Patch fixes that by running `kill` using os.execute with a PID of
tarantool process written to a pid file.

Follows up tarantool#6128

NO_CHANGELOG=fix test
NO_DOC=fix test
ligurio added a commit to tarantool/luatest that referenced this issue Jul 4, 2023
Function grep_log() could be useful for searching string patterns even
when Server instance is not possible. For example a case [1] when we
need to start Tarantool instance with our own options.

Now for using grep_log one needs create an empty Server instance and
then call grep_log() for it. It looks ugly:

```lua
local server = t.Server:new({})
local res = server:grep_log(msg, 1024, {filename = file})
```

Patch moves grep_log() to utils, this allows using grep_log() even
Server instance is not used.

1. tarantool/tarantool#8836

Follows up tarantool/tarantool#6128
ligurio added a commit to tarantool/luatest that referenced this issue Jul 4, 2023
Function grep_log() could be useful for searching string patterns even
when Server instance is not possible. For example a case [1] when we
need to start Tarantool instance with our own options.

Now for using grep_log one needs create an empty Server instance and
then call grep_log() for it. It looks ugly:

```lua
local server = t.Server:new({})
local res = server:grep_log(msg, 1024, {filename = file})
```

Patch moves grep_log() to utils, this allows using grep_log() even
Server instance is not used.

1. tarantool/tarantool#8836

Follows up tarantool/tarantool#6128
ligurio added a commit to tarantool/luatest that referenced this issue Jul 4, 2023
Function grep_log() could be useful for searching string patterns even
when Server instance is not possible. For example a case [1] when we
need to start Tarantool instance with our own options.

Now for using grep_log one needs create an empty Server instance and
then call grep_log() for it. It looks ugly:

```lua
local server = t.Server:new({})
local res = server:grep_log(msg, 1024, {filename = file})
```

Patch moves grep_log() to utils, this allows using grep_log() even
Server instance is not used.

1. tarantool/tarantool#8836

Follows up tarantool/tarantool#6128
ligurio added a commit to tarantool/luatest that referenced this issue Jul 4, 2023
Function grep_log() could be useful for searching string patterns even
when Server instance is not possible. For example a case [1] when we
need to start Tarantool instance with our own options.

Now for using grep_log one needs create an empty Server instance and
then call grep_log() for it. It looks ugly:

```lua
local server = t.Server:new({})
local res = server:grep_log(msg, 1024, {filename = file})
```

Patch moves grep_log() to utils, this allows using grep_log() even
Server instance is not used.

1. tarantool/tarantool#8836

Follows up tarantool/tarantool#6128
ligurio added a commit to tarantool/luatest that referenced this issue Jul 4, 2023
Function grep_log() could be useful for searching string patterns even
when Server instance is not possible. For example a case [1] when we
need to start Tarantool instance with our own options.

Now for using grep_log one needs create an empty Server instance and
then call grep_log() for it. It looks ugly:

```lua
local server = t.Server:new({})
local res = server:grep_log(msg, 1024, {filename = file})
```

Patch moves grep_log() to utils, this allows using grep_log() even
Server instance is not used.

1. tarantool/tarantool#8836

Follows up tarantool/tarantool#6128
ligurio added a commit to ligurio/tarantool that referenced this issue Jul 5, 2023
Test uses a popen module that starts tarantool process in background
mode. Tarantool process started in background mode forks a new process
and closes a parent, after that popen loses a PID of the started process
and `ph:kill()` and `ph:terminate()` doesn't work anymore. It leads to
non-terminated tarantool processes after running the test.

Patch fixes that by running `kill` using os.execute with a PID of
tarantool process written to a pid file.

Follows up tarantool#6128

NO_CHANGELOG=fix test
NO_DOC=fix test
igormunkin pushed a commit that referenced this issue Jul 6, 2023
Test uses a popen module that starts tarantool process in background
mode. Tarantool process started in background mode forks a new process
and closes a parent, after that popen loses a PID of the started process
and `ph:kill()` and `ph:terminate()` doesn't work anymore. It leads to
non-terminated tarantool processes after running the test.

Patch fixes that by running `kill` using os.execute with a PID of
tarantool process written to a pid file.

Follows up #6128

NO_CHANGELOG=fix test
NO_DOC=fix test
igormunkin pushed a commit that referenced this issue Jul 6, 2023
Test uses a popen module that starts tarantool process in background
mode. Tarantool process started in background mode forks a new process
and closes a parent, after that popen loses a PID of the started process
and `ph:kill()` and `ph:terminate()` doesn't work anymore. It leads to
non-terminated tarantool processes after running the test.

Patch fixes that by running `kill` using os.execute with a PID of
tarantool process written to a pid file.

Follows up #6128

NO_CHANGELOG=fix test
NO_DOC=fix test

(cherry picked from commit 8868622)
igormunkin pushed a commit that referenced this issue Jul 6, 2023
Test uses a popen module that starts tarantool process in background
mode. Tarantool process started in background mode forks a new process
and closes a parent, after that popen loses a PID of the started process
and `ph:kill()` and `ph:terminate()` doesn't work anymore. It leads to
non-terminated tarantool processes after running the test.

Patch fixes that by running `kill` using os.execute with a PID of
tarantool process written to a pid file.

Follows up #6128

NO_CHANGELOG=fix test
NO_DOC=fix test

(cherry picked from commit 8868622)
ligurio added a commit to tarantool/luatest that referenced this issue Aug 14, 2023
Function grep_log() could be useful for searching string patterns even
when Server instance is not possible. For example a case [1] when we
need to start Tarantool instance with our own options.

Now for using grep_log one needs create an empty Server instance and
then call grep_log() for it. It looks ugly:

```lua
local server = t.Server:new({})
local res = server:grep_log(msg, 1024, {filename = file})
```

Patch moves grep_log() to utils, this allows using grep_log() even
Server instance is not used.

1. tarantool/tarantool#8836

Follows up tarantool/tarantool#6128
ligurio added a commit to tarantool/luatest that referenced this issue Aug 14, 2023
Function grep_log() could be useful for searching string patterns even
when Server instance is not possible. For example a case [1] when we
need to start Tarantool instance with our own options.

Now for using grep_log one needs create an empty Server instance and
then call grep_log() for it. It looks ugly:

```lua
local server = t.Server:new({})
local res = server:grep_log(msg, 1024, {filename = file})
```

Patch moves grep_log() to utils, this allows using grep_log() even
Server instance is not used.

1. tarantool/tarantool#8836

Follows up tarantool/tarantool#6128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.10 Target is 2.10 and all newer release/master branches bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants