[PATCH v5 0/7] box/console: Improve lua mode for remote console

Cyrill Gorcunov gorcunov at gmail.com
Fri Sep 20 21:45:16 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.

v3:
 - address Kostya comments
v4:
 - optimize lua output handler a bit
v5:
 - resend a clean version

The following changes since commit 4c2d1eff29848cc2ed47cd1d3ca23152fed2e3b9:

  build: update curl submodule to 7.66.0 (2019-09-20 15:04:55 +0300)

are available in the Git repository at:

  https://github.com/cyrillos/tarantool/pull/new/console-fix-5

for you to fetch changes up to d23027975220cb91aeb5a947cc69c4884c6fd9da:

  box/console: Rename output_parse to parse_output (2019-09-20 21:25:50 +0300)

----------------------------------------------------------------
Cyrill Gorcunov (7):
      box/console: Add mapping for direct symbols
      box/console: Relax lua handler from local variables
      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
      box/console: Rename output_parse to parse_output

 src/box/lua/console.lua | 180 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------
 1 file changed, 152 insertions(+), 28 deletions(-)
-- 
2.20.1




More information about the Tarantool-patches mailing list