summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhar7an <99636919+har7an@users.noreply.github.com>2023-02-09 19:40:23 +0000
committerGitHub <noreply@github.com>2023-02-09 19:40:23 +0000
commit5eb2d055ffa23f6775c12d7cc7e900e0d66a3def (patch)
treeeae174bae76d08c7f1a8cd79e598094bb95d0685
parent0255b56f241292cd905711396338614e68334482 (diff)
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>
-rw-r--r--zellij-server/src/os_input_output.rs10
-rw-r--r--zellij-utils/src/ipc.rs3
2 files changed, 11 insertions, 2 deletions
diff --git a/zellij-server/src/os_input_output.rs b/zellij-server/src/os_input_output.rs
index 9c214b705..8e863af49 100644
--- a/zellij-server/src/os_input_output.rs
+++ b/zellij-server/src/os_input_output.rs
@@ -344,6 +344,16 @@ struct ClientSender {
impl ClientSender {
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);
std::thread::spawn(move || {
let err_context = || format!("failed to send message to client {client_id}");
diff --git a/zellij-utils/src/ipc.rs b/zellij-utils/src/ipc.rs
index 81d9e6c89..e76a21bd8 100644
--- a/zellij-utils/src/ipc.rs
+++ b/zellij-utils/src/ipc.rs
@@ -154,8 +154,7 @@ isn't performant enough.
There are a few things you can try now:
- Reattach to your previous session and see if it works out better this
time: {session_tip}
- - Try using a faster terminal. GPU-accelerated terminals such as Kitty
- or Alacritty are cross-platform and known to work well with zellij.
+ - Try using a faster (maybe GPU-accelerated) terminal emulator
"
)
},