cleanups around "buffer full" error (#2136)

* server/os_i_o: Add fixme to IPC queue

between server and client, explaining why the queue has its current
length.

* utils/ipc: Don't advertise terminal emulators

and use a more generic phrasing instead. zellij as application isn't the
place to recommend specific terminals to use it with.

* style(comment): redraw-on-backpressure comment

---------

Co-authored-by: Aram Drevekenin <aram@poor.dev>
This commit is contained in:
har7an 2023-02-09 19:40:23 +00:00 committed by GitHub
parent 0255b56f24
commit 5eb2d055ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View file

@ -344,6 +344,16 @@ struct ClientSender {
impl ClientSender { impl ClientSender {
pub fn new(client_id: ClientId, mut sender: IpcSenderWithContext<ServerToClientMsg>) -> Self { pub fn new(client_id: ClientId, mut sender: IpcSenderWithContext<ServerToClientMsg>) -> Self {
// FIXME(hartan): This queue is responsible for buffering messages between server and
// client. If it fills up, the client is disconnected with a "Buffer full" sort of error
// message. It was previously found to be too small (with depth 50), so it was increased to
// 5000 instead. This decision was made because it was found that a queue of depth 5000
// doesn't cause noticable increase in RAM usage, but there's no reason beyond that. If in
// the future this is found to fill up too quickly again, it may be worthwhile to increase
// the size even further (or better yet, implement a redraw-on-backpressure mechanism).
// We, the zellij maintainers, have decided against an unbounded
// queue for the time being because we want to prevent e.g. the whole session being killed
// (by OOM-killers or some other mechanism) just because a single client doesn't respond.
let (client_buffer_sender, client_buffer_receiver) = channels::bounded(5000); let (client_buffer_sender, client_buffer_receiver) = channels::bounded(5000);
std::thread::spawn(move || { std::thread::spawn(move || {
let err_context = || format!("failed to send message to client {client_id}"); let err_context = || format!("failed to send message to client {client_id}");

View file

@ -154,8 +154,7 @@ isn't performant enough.
There are a few things you can try now: There are a few things you can try now:
- Reattach to your previous session and see if it works out better this - Reattach to your previous session and see if it works out better this
time: {session_tip} time: {session_tip}
- Try using a faster terminal. GPU-accelerated terminals such as Kitty - Try using a faster (maybe GPU-accelerated) terminal emulator
or Alacritty are cross-platform and known to work well with zellij.
" "
) )
}, },