axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ananth Krishna" ...@it-innovation.soton.ac.uk>
Subject RE: Fix for a bug in ManagedMemoryDataSource
Date Wed, 06 Oct 2004 11:00:09 GMT
Dims,
 Apologies for not adding the diff.txt in the first place itself. I
missed that bit when I was going through the instructions on the website
for submitting patches. The differences are now in JIRA along with the
reported bug and patch. If this can be tested and released in one of the
future releases due soon, it would make things a lot easier for us.

Thanks
 Ananth 

> -----Original Message-----
> From: Davanum Srinivas [mailto:davanum@gmail.com] 
> Sent: 05 October 2004 17:34
> To: Ananth Krishna
> Cc: axis-dev@ws.apache.org
> Subject: Re: Fix for a bug in ManagedMemoryDataSource
> 
> Ananth,
> 
> Can you please add a diff between the original and the new 
> file and upload the diff to JIRA?
> 
> thanks,
> dims
> 
> 
> On Tue, 5 Oct 2004 17:19:38 +0100, Ananth Krishna 
> <ak@it-innovation.soton.ac.uk> wrote:
> > Hi dims,
> >  As suggested I have raised this as an issue in JIRA 
> (AXIS-1584) and 
> > attached the source file with my suggested fix in it. Would 
> you know 
> > if there is any possibility this might make it to the 1_2 
> RC2 or 1_2 
> > final release as this is really preventing us/our partners from 
> > handling large soap attachments..
> > 
> > Thanks
> >  Ananth
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: Davanum Srinivas [mailto:davanum@gmail.com]
> > > Sent: 04 October 2004 15:43
> > > To: axis-dev@ws.apache.org
> > > Subject: Re: Fix for a bug in ManagedMemoryDataSource
> > >
> > > Ananth,
> > >
> > > Can you please open a bug report in JIRA
> > > (http://issues.apache.org/jira) and submit the patch 
> (guidelines at 
> > > http://nagoya.apache.org/wiki/apachewiki.cgi?AxisProjectPages/
> > > SubmitPatches).
> > > So that we don't forget this patch/fix.
> > >
> > > thanks,
> > > dims
> > >
> > >
> > > On Thu, 30 Sep 2004 16:24:12 +0100, Ananth Krishna 
> > > <ak@it-innovation.soton.ac.uk> wrote:
> > > > I am sending this mail to the developers list as I have
> > > noticed what
> > > > seems to me like a bug in the ManagedMemoryDataSource class
> > > in axis1_2
> > > > beta version. We are using javax.activation.DataHandler 
> for soap 
> > > > attachments and are aware that axis manages data sources in
> > > 1_2 beta
> > > > with the ManagedMemoryDataSource class.
> > > >
> > > > Since then, we had also noticed that temp files created by
> > > axis when
> > > > handling soap attachments weren't being cleaned up. 
> Hence, we are 
> > > > explicitly calling 'delete' method on ManagedMemoryDataSource 
> > > > after ensuring that the data source returned from 
> > > > javax.activation.DataHandler is of the right type.
> > > >
> > > > For small attachments up to a few kilobytes this worked
> > > well but when
> > > > we try to upload larger soap attachments of the order of
> > > 5-6 megabytes
> > > > the delete operation on ManagedMemoryDataSource 
> complained with a 
> > > > java.util.ConcurrentModificationException on a 
> WeakHashMap used in 
> > > > this class.
> > > >
> > > > I dug deeper into the code and didn't quite realise why a
> > > WeakHashMap
> > > > was used here but it seemed to me that there can be a
> > > potential race
> > > > condition here and we seem to be hitting it by uploading
> > > larger soap
> > > > attachments.
> > > >
> > > > The delete() method of the main ManagedMemoryDataSource
> > > class, while
> > > > iterating over the elements of the defined WeakHashMap, deletes 
> > > > elements of the WeakHashMap. As most of us know, this 
> usually is a 
> > > > cause for ConcurrentModificationException to be thrown on
> > > HashMaps/WeakHashMaps.
> > > >
> > > > Deleting elements in the WeakHashMap is actually done in
> > > the close()
> > > > method of the private class inside 
> ManagedMemoryDataSource which 
> > > > is invoked from the delete() method. As the close() 
> method is used 
> > > > all over the place in this class, I have created a separate
> > > closeStream()
> > > > method which doesn't attempt to delete/modify elements of
> > > this HashMap
> > > > and is invoked as before from inside the delete method.
> > > This shouldn't
> > > > affect elements of the HashMap being removed as the HashMap
> > > is cleared
> > > > at the end of the delete() method anyway.
> > > >
> > > > I am submitting the changes I have done to this class with
> > > this email.
> > > > We have tested this class in the context that I have just 
> > > > described and it seems to work well and were hoping 
> this patch can 
> > > > be
> > > included
> > > > in the next release of axis..
> > > >
> > > > Thanks & Regards
> > > >  Ananth
> > > >
> > > > Ananth Krishna
> > > > IT Innovation Centre
> > > > 2 Venture Road
> > > > Chilworth Science Park
> > > > Southampton, SO16 7NP, UK
> > > >
> > > > tel:  +44 23 8076 0834
> > > > fax: +44 23 8076 0833
> > > >
> > > > mailto:ak@it-innovation.soton.ac.uk
> > > > http://www.it-innovation.soton.ac.uk
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Davanum Srinivas - http://webservices.apache.org/~dims/
> > >
> > 
> 
> 
> --
> Davanum Srinivas - http://webservices.apache.org/~dims/
> 

Mime
View raw message