Skip to content

Conversation

@jeanouii
Copy link
Contributor

@jeanouii jeanouii commented Feb 5, 2026

To be discussed. On Github Actions for Windows nodes, it consistently fails.

On Windows, files cannot be renamed/moved while open by another process. The simplest and most appropriate fix is to skip this test on Windows where file locking makes it inherently unreliable.

@jeanouii
Copy link
Contributor Author

jeanouii commented Feb 5, 2026

FYI, here is the stack trace on Windows

java.io.IOException: Failed to move target\activemq-data\localhost\KahaDB\db-6.log to D:\a\activemq\activemq\activemq-kahadb-store\target\activemq-data\localhost\KahaDB\data-archive - target\activemq-data\localhost\KahaDB\db-6.log -> D:\a\activemq\activemq\activemq-kahadb-store\target\activemq-data\localhost\KahaDB\data-archive\db-6.log: The process cannot access the file because it is being used by another process
	at org.apache.activemq.util.IOHelper.moveFile(IOHelper.java:200)
	at org.apache.activemq.store.kahadb.disk.journal.DataFile.move(DataFile.java:107)
	at org.apache.activemq.store.kahadb.disk.journal.Journal.forceRemoveDataFile(Journal.java:833)
	at org.apache.activemq.store.kahadb.disk.journal.Journal.removeDataFiles(Journal.java:812)
	at org.apache.activemq.store.kahadb.MessageDatabase.checkpointUpdate(MessageDatabase.java:1701)
	at org.apache.activemq.store.kahadb.MessageDatabase.checkpointCleanup(MessageDatabase.java:1035)
	at org.apache.activemq.store.kahadb.KahaDBStore.checkpoint(KahaDBStore.java:1481)

@mattrpav
Copy link
Contributor

mattrpav commented Feb 5, 2026

A debug on macos confirmed that when the move is requested, the db-6.log file is not opened by the Java process.

Note: This may be a race condition if close is async.

@mattrpav
Copy link
Contributor

mattrpav commented Feb 5, 2026

The exception is wrapped and the original exception and stacktrace is lost-- I made a quick change to see if we can get the full stacktrace

ref: #1655

@jeanouii jeanouii changed the title [WIP] Exclude JournalArchiveTest from Windows builds to reduce test flakiness [AMQ-9856] Journal move fails on Windows Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants