Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1229434

Summary: [GSS](6.4.z) HornetQ won’t start if one of the journal files is truncated for any reason
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Matthew Robson <mrobson>
Component: HornetQAssignee: Tomas Hofman <thofman>
Status: CLOSED CURRENTRELEASE QA Contact: Miroslav Novak <mnovak>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.1CC: bmaxwell, cdewolf, csuconic, jawilson, msvehla, thofman
Target Milestone: CR1   
Target Release: EAP 6.4.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1196524, 1219165    

Description Matthew Robson 2015-06-08 17:56:04 UTC
Description of problem:
HornetQ won’t start if one of the journal files is truncated for any reason.  In this case, there was a 0 byte journal file left behind.  This will happen if any file is less then the header-size.

Version-Release number of selected component (if applicable):


How reproducible:
Random.

Steps to Reproduce:
1.
2.
3.

Actual results:

09:14:56,186 SEVERE [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-3) Failure in initialisation: java.nio.BufferUnderflowException
	at java.nio.Buffer.nextGetIndex(Buffer.java:498) [rt.jar:1.7.0_71]
	at java.nio.HeapByteBuffer.getInt(HeapByteBuffer.java:355) [rt.jar:1.7.0_71]
	at org.hornetq.core.journal.impl.JournalImpl.readFileHeader(JournalImpl.java:2807) [hornetq-core-2.2.24.BZ928936.jar:2.2.24.BZ928936 (HQ_2_2_24_BZ928936, 122)]
	at org.hornetq.core.journal.impl.JournalImpl.orderFiles(JournalImpl.java:399) [hornetq-core-2.2.24.BZ928936.jar:2.2.24.BZ928936 (HQ_2_2_24_BZ928936, 122)]
	at org.hornetq.core.journal.impl.JournalImpl.load(JournalImpl.java:1884) [hornetq-core-2.2.24.BZ928936.jar:2.2.24.BZ928936 (HQ_2_2_24_BZ928936, 122)]
	at org.hornetq.core.journal.impl.JournalImpl.load(JournalImpl.java:1496) [hornetq-core-2.2.24.BZ928936.jar:2.2.24.BZ928936 (HQ_2_2_24_BZ928936, 122)]
	at org.hornetq.core.journal.impl.JournalImpl.load(JournalImpl.java:1480) [hornetq-core-2.2.24.BZ928936.jar:2.2.24.BZ928936 (HQ_2_2_24_BZ928936, 122)]
	at org.hornetq.core.persistence.impl.journal.JournalStorageManager.loadMessageJournal(JournalStorageManager.java:936) [hornetq-core-2.2.24.BZ928936.jar:2.2.24.BZ928936 (HQ_2_2_24_BZ928936, 122)]
	at org.hornetq.core.server.impl.HornetQServerImpl.loadJournals(HornetQServerImpl.java:1731) [hornetq-core-2.2.24.BZ928936.jar:2.2.24.BZ928936 (HQ_2_2_24_BZ928936, 122)]
	at org.hornetq.core.server.impl.HornetQServerImpl.initialisePart2(HornetQServerImpl.java:1547) [hornetq-core-2.2.24.BZ928936.jar:2.2.24.BZ928936 (HQ_2_2_24_BZ928936, 122)]
	at org.hornetq.core.server.impl.HornetQServerImpl.access$1200(HornetQServerImpl.java:141) [hornetq-core-2.2.24.BZ928936.jar:2.2.24.BZ928936 (HQ_2_2_24_BZ928936, 122)]
	at org.hornetq.core.server.impl.HornetQServerImpl$SharedStoreLiveActivation.run(HornetQServerImpl.java:2060) [hornetq-core-2.2.24.BZ928936.jar:2.2.24.BZ928936 (HQ_2_2_24_BZ928936, 122)]
	at org.hornetq.core.server.impl.HornetQServerImpl.start(HornetQServerImpl.java:369) [hornetq-core-2.2.24.BZ928936.jar:2.2.24.BZ928936 (HQ_2_2_24_BZ928936, 122)]
	at org.hornetq.jms.server.impl.JMSServerManagerImpl.start(JMSServerManagerImpl.java:282) [hornetq-jms-2.2.24.BZ928936.jar:2.2.24.BZ928936 (HQ_2_2_24_BZ928936, 122)]
	at org.jboss.as.messaging.jms.JMSService.start(JMSService.java:73) [jboss-as-messaging-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_71]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_71]
	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_71]



Expected results:
Handle the truncated file gracefully.

Additional info:

Comment 1 JBoss JIRA Server 2015-06-10 13:59:51 UTC
Tomas Hofman <thofman> updated the status of jira HORNETQ-1479 to Coding In Progress

Comment 2 JBoss JIRA Server 2015-06-10 14:00:57 UTC
Tomas Hofman <thofman> updated the status of jira HORNETQ-1479 to Resolved

Comment 6 Miroslav Novak 2015-06-23 09:53:20 UTC
Verified in EAP 6.4.2.CP.CR1.

Comment 7 Petr Penicka 2017-01-17 10:16:28 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.

Comment 8 Petr Penicka 2017-01-17 10:16:32 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.