You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MemoryMappedFileAppender ignores immediateFlush=true due to hard-coded false #4480
Expected: immediateFlush="true" on MemoryMappedFile forces the mapped buffer after every event.
Actual: the appender's own flag is always false (getImmediateFlush() returns false); only the manager receives the configured true.
Affects: 2.25.3 and 2.26.1, 2.x and main heads.
Reproducer: configure <MemoryMappedFile immediateFlush="true">, read getImmediateFlush() from the appender after startup.
Original report:
Description
MemoryMappedFileAppender does not honor the configured immediateFlush option.
In MemoryMappedFileAppender.Builder.build(), the configured value is correctly passed to MemoryMappedFileManager,
PR #4325 addresses a similar problem in ConsoleAppender (also see #4262, #4327), in which a hard-coded constructor argument causes an appender to ignore its configured immediateFlush value.
Thanks, confirmed: MemoryMappedFileAppender.Builder.build() hands the configured value to the manager but a literal false to the appender, so the mapped buffer is only forced at end of batch, remap or close. Same on 2.x and main.
Your one-line fix is the right one. A PR against 2.x with a test in MemoryMappedFileAppenderTest asserting getImmediateFlush() for both values, plus a changelog entry like 4262_console_immediate_flush.xml, would be welcome.
Activity
ramanathan1504 commentedon Nov 14, 2026
Thanks, confirmed:
MemoryMappedFileAppender.Builder.build()hands the configured value to the manager but a literalfalseto the appender, so the mapped buffer is only forced at end of batch, remap or close. Same on2.xandmain.Your one-line fix is the right one. A PR against
2.xwith a test inMemoryMappedFileAppenderTestassertinggetImmediateFlush()for both values, plus a changelog entry like4262_console_immediate_flush.xml, would be welcome.Honor immediateFlush in MemoryMappedFileAppender