box/console: Fix hang in remote console lua mode
If we change output mode on remote machine via text-based session node a (server) ------ require('console').listen('unix/:/tmp/X.sock') ... node b (client) ------ require('console').connect('unix/:/tmp/X.sock') connected to unix/:/tmp/X.sock ... unix/:/tmp/X.sock> \set output lua the client get stuck forever, it is because the text wire protocol waits for yaml eos terminator which of course never hit the peer, because lua mode uses own one. Thus to fix this problem we have to preprocess the text we're passing to the server, just like we do in local console. So we reuse command parsing code and remember current output terminator in text_connection_mt instance. Another problem is that named default output mode. There could be a mixed environment where server operates in default lua mode but client connects with yaml mode. To break a tie we yield "\set output" command with current output mode when establishing a connection. Since the output format is per-session bound this doesn't affect any other connections on a server. Part-of #3834 Signed-off-by:Cyrill Gorcunov <gorcunov@gmail.com> (cherry picked from commit c358398c)
Loading
Please register or sign in to comment