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

Consolidate LogFile implementation to use FileOutputStream #4431

Open
matejk opened this issue Jan 31, 2024 · 1 comment
Open

Consolidate LogFile implementation to use FileOutputStream #4431

matejk opened this issue Jan 31, 2024 · 1 comment

Comments

@matejk
Copy link
Contributor

matejk commented Jan 31, 2024

LogFile has different implementations for Windows using Win32 API and STD for other platforms where Poco::FileOutputStream is used. Poco::FileOutputStream has Windows and Posix implementations.

LogFile calls FlushFileBuffers on Windows which forcefully flushes buffers to disk. Posix equivalent would be fsync.

  • New function fsync (or flushToDisk) shall be added to FileStream_POSIX and FileStream_WIN32.
  • Implementation of LogFile shall be unified to use FileOutputStream

Related: #2443, #4429.

@matejk matejk added this to the Release 1.14.0 milestone Jan 31, 2024
@matejk
Copy link
Contributor Author

matejk commented Feb 1, 2024

Logically, there should be only LogFile, because we have POSIX and WIN32 FileStream; performance may be the reason for the current state.

Some benchmarking would help to make the right decision, ie. whether it makes sense to introduce LogFile_POSIX, instead of having just one LogFile.

As for flush/sync, those should be two separate properties and they should have strategies with reasonable defaults.

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

No branches or pull requests

1 participant