Issue Details (XML | Word | Printable)

Key: AMQ-1235
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Hiram Chirino
Reporter: Alex Burgel
Votes: 0
Watchers: 0
Operations

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

Scheduler.cancel uses incorrect argument to shutdown threads

Created: 24/Apr/07 06:03 AM   Updated: 01/May/07 05:51 AM
Return to search
Component/s: None
Affects Version/s: 4.1.1
Fix Version/s: 4.1.2, 5.0.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works scheduler.patch 2007-04-24 02:42 PM Alex Burgel 1.0 kB
Issue Links:
Related
 


 Description  « Hide
looking at the code from 4.1.1 in org.apache.activemq.thread.Scheduler, in the cancel method:

the Runnable task argument is passed to clockDaemon.remove(). i think this is incorrect. ScheduledFuture ticket should be passed to clockDaemon.remove().

the javadocs of ScheduledThreadPoolExecutor.remove discuss the possibility that Runnables might be stored in some other form internally, so calling remove with a plain Runnable might not do anything. I think the solution is to call remove with a ScheduledFuture, which is how they are stored internally in ScheduledThreadPoolExecutor.

i came across this bug after upgrading to the java 5 version of backport-util-concurrent 3.0. that version makes more assumptions about the types that are passed into ScheduledThreadPoolExecutor.remove, so when you pass in a regular Runnable you'll get a ClassCastException.

this is trivial to fix, so i don't think a patch is necessary. also i think this might address the memory leak mentioned in AMQ-1205



 All   Comments   Work Log   Change History   Subversion Commits   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Alex Burgel made changes - 24/Apr/07 02:42 PM
Field Original Value New Value
Attachment scheduler.patch [ 15450 ]
James Strachan made changes - 30/Apr/07 05:56 AM
Assignee Hiram Chirino [ chirino ]
James Strachan made changes - 30/Apr/07 05:56 AM
Link This issue is related to AMQ-1205 [ AMQ-1205 ]
Hiram Chirino made changes - 30/Apr/07 06:17 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Fix Version/s 4.1.2 [ 11801 ]
Fix Version/s 4.2.0 [ 11712 ]