[tarantool-patches] [PATCH v2 0/5] box/console: Improve lua mode for remote console

Cyrill Gorcunov gorcunov at gmail.com
Sat Aug 31 00:48:03 MSK 2019


This series address a problem where we can hang a connection setting up
lua mode while server continue treating all data as having built-in yaml
end of string terminator.

We've a long discussion with @alexander.turenko about our test engine
and console eos in general and at first concluded that by default we
should not use ";" as lua terminator but continue using empty string
instead. Actually after thinking more I fear it won't work -- a user
might connect to remote console and this connection will hang because
server will reply with empty eos while we're using read() from socket
with terminator at the end of string. Moreover since our yaml serializer
*always* yield eos terminator I think we should do the same for lua
mode just to be consistent in architecture.

Still for convenience I added ability to zap lua terminator via
require('console').eos("") command. Thus users on local consoles
can drop ';' eos if they want to.

Next to test engine:

1) I think we should convert each test one by one, not the
   whole bunch of tests in a single pass

2) For this sake we need to send something like "\set output lua"
   to the server for a particular test

3) We need to describe somehow which mode a test uses. Sasha pointed
   that he has a string on top of "result" file where we could provide
   some kind of settings describing output mode. But I think maybe we
   could introduce .desc files in json format where we could add per-file
   settings instead (in addition to ini files). Putting test description
   in "result" file looks a bit inconvenient for me. Guys, what do you think?

Regardless of the test engine issues which I have to address I think the
series should be merged since it closes real bugs.

---

The following changes since commit 51d8e4c35ca1da255b4ebea9850ec2a84365e0a3:

  box/memtx: strip_core -- Warn on linux only (2019-08-29 22:27:15 +0300)

are available in the Git repository at:

  https://github.com/cyrillos/tarantool.git console-fix-1

for you to fetch changes up to 9236f677fcf1bde39f9eb004693865c40b449abc:

  box/console: Provide console.eos() api (2019-08-30 23:46:32 +0300)

----------------------------------------------------------------
Cyrill Gorcunov (5):
      box/console: Add mapping for direct symbols
      box/console: Add explicit output EOS mapping
      box/console: Refactor command handling
      box/console: Fix hang in remote console lua mode
      box/console: Provide console.eos() api

 src/box/lua/console.lua | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 116 insertions(+), 13 deletions(-)




More information about the Tarantool-patches mailing list