rtail icon indicating copy to clipboard operation
rtail copied to clipboard

tmux echo loops in several panes -> in rtail stream mixed output from several panes

Open ghost opened this issue 9 years ago • 11 comments

After clicking at stream link output becomes mixed (from other tmux panes).

ghost avatar Feb 01 '16 07:02 ghost

Hey @a93ushakov do you mind providing the exact steps to reproduce this?

kilianc avatar Feb 01 '16 16:02 kilianc

rtail-server --web-port 8081
tmux kill-server
#!/bin/bash
SESSION=test

tmux -2 new-session -d -s $SESSION

tmux new-window -t $SESSION:1 -n 'test0'
tmux send-keys "while true; do echo test0 && sleep 3; done | rtail --id test0" C-m

tmux new-window -t $SESSION:2 -n 'test1' 
tmux send-keys "while true; do echo test1 && sleep 3; done | rtail --id test1" C-m

# Attach to session
tmux -2 attach-session -t $SESSION

ghost avatar Feb 01 '16 16:02 ghost

2016-02-01-185820_1600x900_scrot

ghost avatar Feb 01 '16 16:02 ghost

On paper this should work, but I never used tmux so I need to dig into the issue to understand why this is happening. rtail is so stupid simple that it seems almost impossible this could happen, really weird.

Thanks for reporting @a93ushakov !

kilianc avatar Feb 01 '16 17:02 kilianc

Thank you for reply - on github developer's quick response is rarity.

Maybe this help.

docker run -ti debian /bin/bash -c "apt-get update && apt-get install -y --no-install-recommends tmux"

ghost avatar Feb 01 '16 18:02 ghost

Same issue here. @kilianc please let me know if you can't reproduce.

mfornasa avatar Feb 24 '16 15:02 mfornasa

Problem is here: https://github.com/kilianc/rtail/blob/develop/cli/rtail-server.js#L111. The server fails to leave the rooms.

For example, after:

  • Selecting stream a
  • Selecting stream b
  • Selecting stream a

socket.rooms is:

{ '/#64bZvp1LYpHSMusqAAAB': '/#64bZvp1LYpHSMusqAAAB',
  a: 'a',
  b: 'b' }

I'm not sure what the /#64bZvp1LYpHSMusqAAAB blurb is, but socket.leave(socket.rooms[0]) acts on it instead of acting on a or b.

mfornasa avatar Mar 25 '16 13:03 mfornasa

Changing line 111 with:

    Object.keys(socket.rooms).forEach(function(key) {
      socket.leave(socket.rooms[key])
    });

solves this for me.

mfornasa avatar Mar 25 '16 13:03 mfornasa

PR: https://github.com/kilianc/rtail/pull/114

mfornasa avatar Mar 25 '16 13:03 mfornasa

@kilianc this is an amazing project. great work. :-)

I am facing the same issue.

This is easy to reproduce... simply rtail two files with separate id where data is getting continuously appended. You'll notice that the output is getting mixed across streams when you switch streams in UI.

I am on latest Ubuntu and latest production rtail. Hope this helps. :-)

I would love if we can release a 0.2.x with this fix instead of waiting for 0.3 since this makes rtail UI unusable with multiple files streaming in.

shamasis avatar Sep 09 '17 09:09 shamasis

Thanks @mfornasa for https://github.com/kilianc/rtail/pull/114/files which IMO should be merged. In the meantime here is a hack:

sudo cp /usr/local/lib/node_modules/rtail/cli/rtail-server.js /usr/local/lib/node_modules/rtail/cli/rtail-server.js.old
sudo curl https://raw.githubusercontent.com/mfornasa/rtail/ed16d9e54d19c36ff2b76e68092cb3188664719f/cli/rtail-server.js -o /usr/local/lib/node_modules/rtail/cli/rtail-server.js
ps -ef | grep rtail-server | grep -v grep | awk '{print $2}' | xargs kill
diff /usr/local/lib/node_modules/rtail/cli/rtail-server.js /usr/local/lib/node_modules/rtail/cli/rtail-server.js.old

nestoru avatar Oct 16 '17 20:10 nestoru