Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle "too many open files" better #2

Closed
dnut opened this issue May 12, 2022 · 1 comment
Closed

handle "too many open files" better #2

dnut opened this issue May 12, 2022 · 1 comment

Comments

@dnut
Copy link
Owner

dnut commented May 12, 2022

Since polling happens frequently, this error happens every few minutes, which breaks the rust process so it must exit and be restarted:

thread 'main' panicked at 'Sending a message failed.: EMFILE', /home/drew/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/wayland-client-0.29.4/src/rust_imp/proxy.rs:211:39

This is a problem in wayland-rs, see YaLTeR/wl-clipboard-rs#12 and Smithay/wayland-rs#235.

The current solution is to just restart the app with a shell script any time it exits. I'm sure there is a more elegant way to do this.

Ideally the process can clean up its own open files, but I'm not sure there's a way to do this without fixing the library. So we probably have to live with the fact that the process must terminated to close all the files, and then a new process must be spawned.

At the very least we can manage the process by forking from rust instead of bash. Some exit status can be used to indicate why the process had to exit. So when the failure is EMFILE the process can be restarted, but otherwise it can exit the entire service if desired.

@dnut dnut mentioned this issue May 12, 2022
dnut added a commit that referenced this issue Jul 28, 2022
… of looping shell script, and #5 "lingering open windows" by terminating every 10 minutes
@dnut
Copy link
Owner Author

dnut commented Jul 28, 2022

simple MVP solution: loop in rust with a fork instead of using a shell script. no conditional error handling

@dnut dnut closed this as completed Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant