-
Notifications
You must be signed in to change notification settings - Fork 56
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
start_with_specfile doesn't allow multiple instances of the program #59
Comments
Strange. Which platform do you use? Can you provide more details on the error? |
The platform is OpenSUSE Linux 15.0, kernel 4.12.14-lp150.12.82-default, x86_64, rust 1.44.1. This is a (slightly modified) original code:
This is the error I get: |
Is the failure occuring only if the specfile did not exist before starting the executables? Does the Debug-print of the error provide some more info? The error String shown is only used by FlexiLoggerError::SpecfileNotify, which has as source error a notify::Error, which should provide some additional information. |
The specfile always exists, in both instances. It's the same source tree, I'm just doing "cargo run" from 2 terminal windows. The debug output: |
Code 9 says |
No, not at all.
Yes. I also don't see config_log.toml in lsof output. I also tried changing the config filename to "config_log2.toml". The first instance created it during launch, the second instance gave me the same error. |
I can't reproduce so far, neither on Windows, nor on Suse 12.2. I tried with a main with this body: flexi_logger::Logger::with_str("info").start_with_specfile("config_log.toml").unwrap();
log::info!("Starting");
log::trace!("Should not be seen");
std::thread::sleep(std::time::Duration::from_secs(10));
log::trace!("Tracing works!!");
log::info!("Terminating"); which gave me some time to modify the specfile after starting, and verify both were reacting. What version of |
Hi, the version I was using was 0.15.8, I updated cargo.toml to use 0.5.10. OK so I did some additional testing with your code above and mine. However, I have rebooted a few times after I first encountered this problem, and it always reappears, so it looks to me that once the system is loaded properly (many files open in IDEs, etc...) and running for some time, there is some kind of resource starvation situation related to notify. I would expect a different error message but maybe there is a bug in kernel that causes "Bad file descriptor" instead of ENOSPC or similar. Is it possible to add API to simply disable notify (perhaps a cargo feature)? Or, perhaps, add a flag that doesn't cause complete failure if notify is failing? In my application there is absolutely no need for this - actually, I'd rather not have any file monitoring for security. Thanks! |
Is it possible to add API to simply disable notify (perhaps a cargo feature)? For the time being, you could use |
Thanks! I really appreciate it! |
You can now use feature |
Hi,
My program uses flexi_logger with a specfile. But, if I launch 2 instances in parallel, the second one does not enable logging and fails with: "Filesystem notifications for the specfile could not be set up".
I think it should be possible to run 2 instances with the same configuration without specfile filesystem notifications. Perhaps add an option to disable the "automatic reloading at runtime" feature?
Thanks!
The text was updated successfully, but these errors were encountered: