rtail
rtail copied to clipboard
tmux echo loops in several panes -> in rtail stream mixed output from several panes
After clicking at stream link output becomes mixed (from other tmux panes).
Hey @a93ushakov do you mind providing the exact steps to reproduce this?
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

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 !
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"
Same issue here. @kilianc please let me know if you can't reproduce.
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.
Changing line 111 with:
Object.keys(socket.rooms).forEach(function(key) {
socket.leave(socket.rooms[key])
});
solves this for me.
PR: https://github.com/kilianc/rtail/pull/114
@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.
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