Github user andytaylor commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/326#discussion_r50105212
--- Diff:
artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalFilesRepository.java
---
@@ -431,13 +434,16 @@ public JournalFile openFile() throws
InterruptedException {
openFilesExecutor.execute(pushOpenRunnable);
}
- JournalFile nextFile = null;
+ JournalFile nextFile = openedFiles.poll(5, TimeUnit.SECONDS);
+ if (nextFile == null) {
+
fileFactory.onIOError(ActiveMQJournalBundle.BUNDLE.fileNotOpened(), "unable to
open ", null);
+ }
- while (nextFile == null) {
- nextFile = openedFiles.poll(5, TimeUnit.SECONDS);
- if (nextFile == null) {
-
fileFactory.onIOError(ActiveMQJournalBundle.BUNDLE.fileNotOpened(), "unable to
open ", null);
- }
+ if (nextFile == null) {
+ // We need to reconnect the current file with the timed buffer
as we were not able to roll the file forward
+ // If you don't do this you will get a NPE in
TimedBuffer::checkSize where it uses the bufferobserver
+ fileFactory.activateBuffer(journal.getCurrentFile().getFile());
--- End diff --
can you use the BUNDLE here Tom, see ActiveMQJournalBundle.BUNDLE
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---