Skip to content

FileChannel doesn't flush to disk on unix until close #2443

@sdaly2107

Description

@sdaly2107

Expected behavior

When FileChannel flushing is disabled, the contents should still be written to disk eventually without flushing after every write.

Actual behavior

On Windows this works fine, but on Linux the contents are not flushed until I close the channel. Opening and closing the channel for every message or enabling flushing does not give us the performance we require.

Steps to reproduce the problem

-Create FileChannel with flush false. Log some messages, wait several ms and check file on disk.
-Messages should be in the file
-On Windows this is working fine, but on Linux the file is empty. Closing the channel OR enabling flushing makes this work, however I expect this to work with flushing disabled and without having to close the channel.

POCO version

1.7.9

Compiler and version

gcc 7.3.0

Operating system and version

Ubuntu 18.04

Other relevant information

Metadata

Metadata

Assignees

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions