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

Missing Flush File can lead to data loss #11

Open
danzu82 opened this issue Oct 20, 2023 · 1 comment
Open

Missing Flush File can lead to data loss #11

danzu82 opened this issue Oct 20, 2023 · 1 comment
Assignees

Comments

@danzu82
Copy link

danzu82 commented Oct 20, 2023

We're investigating the Logger framework for use on a real-time system. It seems to work fine so far, except one issue. When the controller shuts down unexpectedly (power loss in the middle of operation) the logfile is deleted after the restart. It might be because the file is never actually written to disk, but is only in memory.
I looked at the code, and I added a Flush File in the False case in File.lvlib:Write.vi. This seems to resolve the issue, the logfile is still there after an unexpected shutdown.
I'm aware this might have consequences on the performance, since this forces the file write to disk to be synchronous instead of leaving the decision when to actually write to file to the OS. So probably the best thing would be to make this configurable.

My workaround:
image

Other minor points:

  • File.lvlib:Manager.vi and some other VIs have debugging enabled. This is not ideal for performance reasons.
  • Did you consider setting the "Separate compiled code from source file" checkbox?
@volks73 volks73 self-assigned this Oct 20, 2023
@volks73
Copy link
Member

volks73 commented Oct 20, 2023

I agree that it should be a configuration. I would happy to accept and merge a Pull Request (PR) implementing this feature and creating a new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants