Issue Details (XML | Word | Printable)

Key: AMQ-611
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Hiram Chirino
Reporter: Steve Bate
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ActiveMQ

Race condition in DataContainer

Created: 03/Mar/06 12:13 PM   Updated: 15/Jun/06 03:15 AM
Component/s: None
Affects Version/s: 3.2.2
Fix Version/s: 4.0

Time Tracking:
Not Specified

Environment: Windows XP Pro. Bug found in 3.1 (but appears to still be in 3.2.2)


 Description  « Hide
We are seeing a problem with a IOException from the FileDataBlock when running with multiple slow clients. It appears to be happening because the DataContainer write(byte[]) operation sets the readBlock and writes the data block length then data block content. Another thread sees the read block and reads the data block length but the write thread has not written the contents yet so an IOException or EOFException is thrown in the read thread (in readFully). The write method is synchronized but the read method is not.

See: FileDataBlock.read, FileDataBlock.write, DataContainer.write (line 111), and DataContainer.read (line 131)

I can reproduce the error reliably in a debugger by controlling the order of the operations. Unfortunately it's difficult to write a repeatable automated test case since this is a race condition type of error.

Let me know if you need more information.



 All   Comments   Work Log   Change History   Subversion Commits   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Hiram Chirino made changes - 15/Jun/06 03:15 AM
Field Original Value New Value
Assignee Hiram Chirino [ chirino ]
Fix Version/s 4.0 [ 11660 ]
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]