Crash with too many open files
(Note this looks different from #597 (closed))
Steps to reproduce:
- Switch to a different channel with Ctrl+PageUp or Ctrl+PageDown
- repeat 1 continuously for about a minute
Observed behavior: Fractal crashes with
$ XDG_DATA_DIRS=target/share/:$XDG_DATA_DIRS target/bin/fractal
fractal_gtk::app::backend_loop: SYNC
fractal_gtk::app::backend_loop: SYNC
fractal_gtk::app::backend_loop: SYNC
thread '<unnamed>' panicked at 'Client::new(): reqwest::Error { kind: Builder, source: Os { code: 24, kind: Other, message: "Too many open files" } }', src/libcore/result.rs:1188:5
stack backtrace:
0: 0x55623c5e09b3 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5f0f4503ed3baebc
1: 0x55623c60aa2d - core::fmt::write::h3ebd5957a5c2d94b
2: 0x55623c5ddc15 - std::io::Write::write_fmt::h93da027fbe21e40d
3: 0x55623c5e599e - std::panicking::default_hook::{{closure}}::h761ba90b2222ffcf
4: 0x55623c5e56b0 - std::panicking::default_hook::hafa8f7b104f5e325
5: 0x55623c5e607b - std::panicking::rust_panic_with_hook::hfbb6a993878e9b09
6: 0x55623c5e5c2e - rust_begin_unwind
7: 0x55623c60ce8e - core::panicking::panic_fmt::h70304ecceb719acb
8: 0x55623c6124b7 - core::result::unwrap_failed::h17b23c17ab3624d7
9: 0x55623c1accb9 - core::result::Result<T,E>::expect::h78831231171bbc17
at /build/rustc-1.41.0-src/src/libcore/result.rs:983
10: 0x55623c25f340 - reqwest::blocking::client::Client::new::h6a592b566f037dd8
at /home/symphorien/src/fractal/build/target/cargo-home/registry/src/github.com-1ecc6299db9ec823/reqwest-0.10.3/src/blocking/client.rs:503
11: 0x55623bdea6c5 - fractal_matrix_api::r0::profile::get_display_name::request::h44cbfff756fdb27e
at fractal-matrix-api/src/r0/profile/get_display_name.rs:21
zsh: abort (core dumped) XDG_DATA_DIRS=target/share/:$XDG_DATA_DIRS target/bin/fractal
Expected behavior: No crash
Reproducible: always, tested on two machines, it takes a variable number of Ctrl+PageUp or Down.
Version: fractal 4.2.2 and master (6fee1f8f)