Issue Details (XML | Word | Printable)

Key: JELLY-113
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: dion gillard
Reporter: Gary Franklin
Votes: 0
Watchers: 0
Operations

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

TagSupport concurrency issue

Created: 01/Jul/04 02:47 PM   Updated: 12/Aug/04 05:10 AM
Return to search
Component/s: core / taglib.core
Affects Version/s: None
Fix Version/s: 1.0-beta-4

Time Tracking:
Not Specified

File Attachments:
  Size
Java Source File Licensed for inclusion in ASF works TagSupport.java 2004-07-01 02:48 PM Gary Franklin 11 kB
Text File Licensed for inclusion in ASF works TagSupportPatch.txt 2004-07-01 02:48 PM Gary Franklin 10 kB

Resolution Date: 12/Aug/04 05:10 AM


 Description  « Hide
Assume you have a jelly tag <j:jelly> with children. The following sequence leads to concurrency problems:

1. Instance 1 of Tag is created on thread 1. Body is ScriptBlock
2. Instance 2 of Tag is created on thread 2. Body is same ScriptBlock as Instance 1.
3. doTag -> invokeBody -> getBody -> trimBody is called for Instance 1
4. same for instance 2
5. Instance 1 gets the size of the ScriptBlock
6. Instance 2 gets the size of the ScriptBlock
7. Instance 1 trims whitespace blocks
8. Instance 2 gets an IndexOutOfBounds exception since it resumes execution with an incorrect list size (list was changed by Instance 1).

Both threads concurrently trim the same ScriptBody (the hasTrimmed variable is instance-specific). The attached patch synchronizes access to the body within trimBody.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no subversion log entries for this issue yet.