fix(web-server): thread leak due to excess file watching (#4286)
* fix(web-server): thread leak due to excess file watching * docs(changelog): add PR
This commit is contained in:
parent
8113ddf9db
commit
fd90067e7b
4 changed files with 15 additions and 6 deletions
|
|
@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
* feat: multiple select and bulk pane actions (https://github.com/zellij-org/zellij/pull/4169 and https://github.com/zellij-org/zellij/pull/4171 and https://github.com/zellij-org/zellij/pull/4221)
|
* feat: multiple select and bulk pane actions (https://github.com/zellij-org/zellij/pull/4169 and https://github.com/zellij-org/zellij/pull/4171, https://github.com/zellij-org/zellij/pull/4221 and https://github.com/zellij-org/zellij/pull/4286)
|
||||||
* feat: add an optional key tooltip to show the current keybindings for the compact bar (https://github.com/zellij-org/zellij/pull/4225 and https://github.com/zellij-org/zellij/pull/4279)
|
* feat: add an optional key tooltip to show the current keybindings for the compact bar (https://github.com/zellij-org/zellij/pull/4225 and https://github.com/zellij-org/zellij/pull/4279)
|
||||||
* feat: web-client, allowing users to share sessions in the browser (https://github.com/zellij-org/zellij/pull/4242, https://github.com/zellij-org/zellij/pull/4257 and https://github.com/zellij-org/zellij/pull/4278)
|
* feat: web-client, allowing users to share sessions in the browser (https://github.com/zellij-org/zellij/pull/4242, https://github.com/zellij-org/zellij/pull/4257 and https://github.com/zellij-org/zellij/pull/4278)
|
||||||
* performance: consolidate renders (https://github.com/zellij-org/zellij/pull/4245)
|
* performance: consolidate renders (https://github.com/zellij-org/zellij/pull/4245)
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ use std::sync::{Arc, Mutex};
|
||||||
use tokio::io::AsyncReadExt;
|
use tokio::io::AsyncReadExt;
|
||||||
use tokio::net::{UnixListener, UnixStream};
|
use tokio::net::{UnixListener, UnixStream};
|
||||||
use zellij_utils::consts::WEBSERVER_SOCKET_PATH;
|
use zellij_utils::consts::WEBSERVER_SOCKET_PATH;
|
||||||
|
use zellij_utils::ipc::ClientToServerMsg;
|
||||||
use zellij_utils::web_server_commands::InstructionForWebServer;
|
use zellij_utils::web_server_commands::InstructionForWebServer;
|
||||||
|
|
||||||
pub async fn create_webserver_receiver(
|
pub async fn create_webserver_receiver(
|
||||||
|
|
@ -87,6 +88,16 @@ pub async fn listen_to_web_server_instructions(
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if let Some(os_input) = connection_table
|
||||||
|
.lock()
|
||||||
|
.unwrap()
|
||||||
|
.get_client_os_api(&client_id)
|
||||||
|
{
|
||||||
|
// notify the zellij server of the config change
|
||||||
|
os_input.send_to_server(
|
||||||
|
ClientToServerMsg::ConfigWrittenToDisk(new_config.clone()),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Continue loop to recreate receiver for next message
|
// Continue loop to recreate receiver for next message
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ use http_handlers::{
|
||||||
create_new_client, get_static_asset, login_handler, serve_html, version_handler,
|
create_new_client, get_static_asset, login_handler, serve_html, version_handler,
|
||||||
};
|
};
|
||||||
use ipc_listener::listen_to_web_server_instructions;
|
use ipc_listener::listen_to_web_server_instructions;
|
||||||
|
|
||||||
use types::{
|
use types::{
|
||||||
AppState, ClientOsApiFactory, ConnectionTable, RealClientOsApiFactory, RealSessionManager,
|
AppState, ClientOsApiFactory, ConnectionTable, RealClientOsApiFactory, RealSessionManager,
|
||||||
SessionManager,
|
SessionManager,
|
||||||
|
|
@ -53,7 +54,9 @@ use uuid::Uuid;
|
||||||
use websocket_handlers::{ws_handler_control, ws_handler_terminal};
|
use websocket_handlers::{ws_handler_control, ws_handler_terminal};
|
||||||
|
|
||||||
use zellij_utils::{
|
use zellij_utils::{
|
||||||
|
cli::CliArgs,
|
||||||
consts::WEBSERVER_SOCKET_PATH,
|
consts::WEBSERVER_SOCKET_PATH,
|
||||||
|
ipc::{ClientAttributes, ClientToServerMsg, ExitReason, ServerToClientMsg},
|
||||||
web_server_commands::{
|
web_server_commands::{
|
||||||
create_webserver_sender, send_webserver_instruction, InstructionForWebServer,
|
create_webserver_sender, send_webserver_instruction, InstructionForWebServer,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
use crate::os_input_output::ClientOsApi;
|
use crate::os_input_output::ClientOsApi;
|
||||||
use crate::report_changes_in_config_file;
|
|
||||||
use crate::web_client::control_message::WebServerToWebClientControlMessage;
|
use crate::web_client::control_message::WebServerToWebClientControlMessage;
|
||||||
use crate::web_client::session_management::build_initial_connection;
|
use crate::web_client::session_management::build_initial_connection;
|
||||||
use crate::web_client::types::{ClientConnectionBus, ConnectionTable, SessionManager};
|
use crate::web_client::types::{ClientConnectionBus, ConnectionTable, SessionManager};
|
||||||
|
|
@ -97,10 +96,6 @@ pub fn zellij_server_listener(
|
||||||
os_input.connect_to_server(&zellij_ipc_pipe);
|
os_input.connect_to_server(&zellij_ipc_pipe);
|
||||||
os_input.send_to_server(first_message);
|
os_input.send_to_server(first_message);
|
||||||
|
|
||||||
let mut args_for_report = CliArgs::default();
|
|
||||||
args_for_report.config = config_file_path.clone();
|
|
||||||
report_changes_in_config_file(&args_for_report, &os_input);
|
|
||||||
|
|
||||||
client_connection_bus.send_control(
|
client_connection_bus.send_control(
|
||||||
WebServerToWebClientControlMessage::SwitchedSession {
|
WebServerToWebClientControlMessage::SwitchedSession {
|
||||||
new_session_name: session_name.clone(),
|
new_session_name: session_name.clone(),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue