You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ax...@ws.apache.org on 2004/10/04 18:07:32 UTC
[jira] Created: (AXIS-1584) ConcurrentModificationException in ManagedMemoryDataSource class
Message:
A new issue has been created in JIRA.
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/AXIS-1584
Here is an overview of the issue:
---------------------------------------------------------------------
Key: AXIS-1584
Summary: ConcurrentModificationException in ManagedMemoryDataSource class
Type: Bug
Status: Unassigned
Priority: Major
Project: Axis
Components:
Basic Architecture
Versions:
1.2 Beta
Assignee:
Reporter: Ananth Krishna
Created: Mon, 4 Oct 2004 9:06 AM
Updated: Mon, 4 Oct 2004 9:06 AM
Environment: Windows XP, SUSE 9.0
Description:
SOAP Attachments, when used in axis 1_2 beta leave a trail of temp files and one of the ways I have found for cleaning all temp files is by using the delete method of the ManagedMemoryDataSource (MMDS) class. It works well for small attachments (of the order of kilobytes) but for anything over a few MB (6/7), there is a java.util.ConcurrentModificationException thrown.
I believe I have a patch for it and have tested that it works. This involves a change in an inner class called InStream of the MMDS class.
The close() method of the InStream class is called by the delete() method of the MMDS class. However, the trouble is the delete() method iterates over a WeakHashMap and the close() method in the InStream class tries to remove elements from this WeakHashMap.
To avoid this race condition, I have created another method closeStream() in the InStream class which, can be invoked by the delete() method in the MMDS class.
Deleting elements from the WeakHashMap isnt affected in anyway as the HashMap is cleared of all it's elements before the method returns. Also, all other methods invoking close() can continue to do so in the same manner as we dont touch that method at all..
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Closed: (AXIS-1584) ConcurrentModificationException in ManagedMemoryDataSource class
Posted by ax...@ws.apache.org.
Message:
The following issue has been closed.
Resolver: Davanum Srinivas
Date: Fri, 15 Oct 2004 7:40 AM
Checked in a fix, please review.
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/AXIS-1584
Here is an overview of the issue:
---------------------------------------------------------------------
Key: AXIS-1584
Summary: ConcurrentModificationException in ManagedMemoryDataSource class
Type: Bug
Status: Closed
Priority: Major
Resolution: FIXED
Project: Axis
Components:
Basic Architecture
Versions:
1.2 Beta
Assignee: Davanum Srinivas
Reporter: Ananth Krishna
Created: Mon, 4 Oct 2004 9:06 AM
Updated: Fri, 15 Oct 2004 7:40 AM
Environment: Windows XP, SUSE 9.0
Description:
SOAP Attachments, when used in axis 1_2 beta leave a trail of temp files and one of the ways I have found for cleaning all temp files is by using the delete method of the ManagedMemoryDataSource (MMDS) class. It works well for small attachments (of the order of kilobytes) but for anything over a few MB (6/7), there is a java.util.ConcurrentModificationException thrown.
I believe I have a patch for it and have tested that it works. This involves a change in an inner class called InStream of the MMDS class.
The close() method of the InStream class is called by the delete() method of the MMDS class. However, the trouble is the delete() method iterates over a WeakHashMap and the close() method in the InStream class tries to remove elements from this WeakHashMap.
To avoid this race condition, I have created another method closeStream() in the InStream class which, can be invoked by the delete() method in the MMDS class.
Deleting elements from the WeakHashMap isnt affected in anyway as the HashMap is cleared of all it's elements before the method returns. Also, all other methods invoking close() can continue to do so in the same manner as we dont touch that method at all..
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Commented: (AXIS-1584) ConcurrentModificationException in ManagedMemoryDataSource class
Posted by "Ananth Krishna (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXIS-1584?page=comments#action_54806 ]
Ananth Krishna commented on AXIS-1584:
--------------------------------------
Apologies for the delay in replying to this.
An Array instead of an iterator sounds just fine to me. I have tested the new class and it works :-)
Would this bug fix be included in 1.2 RC1/RC2 or 1.2 final by any chance.
would be very useful if it can be included in one of these releases..
Thanks
Ananth
> ConcurrentModificationException in ManagedMemoryDataSource class
> ----------------------------------------------------------------
>
> Key: AXIS-1584
> URL: http://issues.apache.org/jira/browse/AXIS-1584
> Project: Axis
> Type: Bug
> Components: Basic Architecture
> Versions: 1.2 Beta
> Environment: Windows XP, SUSE 9.0
> Reporter: Ananth Krishna
> Assignee: Davanum Srinivas
> Attachments: bugfixMMDS.zip, diff.txt, stackTraceNOrgSource.zip
>
> SOAP Attachments, when used in axis 1_2 beta leave a trail of temp files and one of the ways I have found for cleaning all temp files is by using the delete method of the ManagedMemoryDataSource (MMDS) class. It works well for small attachments (of the order of kilobytes) but for anything over a few MB (6/7), there is a java.util.ConcurrentModificationException thrown.
> I believe I have a patch for it and have tested that it works. This involves a change in an inner class called InStream of the MMDS class.
> The close() method of the InStream class is called by the delete() method of the MMDS class. However, the trouble is the delete() method iterates over a WeakHashMap and the close() method in the InStream class tries to remove elements from this WeakHashMap.
> To avoid this race condition, I have created another method closeStream() in the InStream class which, can be invoked by the delete() method in the MMDS class.
> Deleting elements from the WeakHashMap isnt affected in anyway as the HashMap is cleared of all it's elements before the method returns. Also, all other methods invoking close() can continue to do so in the same manner as we dont touch that method at all..
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Commented: (AXIS-1584) ConcurrentModificationException in ManagedMemoryDataSource class
Posted by ax...@ws.apache.org.
The following comment has been added to this issue:
Author: Davanum Srinivas
Created: Wed, 6 Oct 2004 4:14 AM
Body:
Ananth,
Can you please post a stack trace? also, won't a simple try/catch around readers.remove(this); do the trick?
thanks,
dims
---------------------------------------------------------------------
View this comment:
http://issues.apache.org/jira/browse/AXIS-1584?page=comments#action_53748
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/AXIS-1584
Here is an overview of the issue:
---------------------------------------------------------------------
Key: AXIS-1584
Summary: ConcurrentModificationException in ManagedMemoryDataSource class
Type: Bug
Status: Unassigned
Priority: Major
Project: Axis
Components:
Basic Architecture
Versions:
1.2 Beta
Assignee:
Reporter: Ananth Krishna
Created: Mon, 4 Oct 2004 9:06 AM
Updated: Wed, 6 Oct 2004 4:14 AM
Environment: Windows XP, SUSE 9.0
Description:
SOAP Attachments, when used in axis 1_2 beta leave a trail of temp files and one of the ways I have found for cleaning all temp files is by using the delete method of the ManagedMemoryDataSource (MMDS) class. It works well for small attachments (of the order of kilobytes) but for anything over a few MB (6/7), there is a java.util.ConcurrentModificationException thrown.
I believe I have a patch for it and have tested that it works. This involves a change in an inner class called InStream of the MMDS class.
The close() method of the InStream class is called by the delete() method of the MMDS class. However, the trouble is the delete() method iterates over a WeakHashMap and the close() method in the InStream class tries to remove elements from this WeakHashMap.
To avoid this race condition, I have created another method closeStream() in the InStream class which, can be invoked by the delete() method in the MMDS class.
Deleting elements from the WeakHashMap isnt affected in anyway as the HashMap is cleared of all it's elements before the method returns. Also, all other methods invoking close() can continue to do so in the same manner as we dont touch that method at all..
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Updated: (AXIS-1584) ConcurrentModificationException in ManagedMemoryDataSource class
Posted by ax...@ws.apache.org.
The following issue has been updated:
Updater: Ananth Krishna (mailto:ak@it-innovation.soton.ac.uk)
Date: Wed, 6 Oct 2004 4:50 AM
Comment:
I have attached a zip file containing the stackTrace and the source of MMDS that has been used in the binary (1_2 beta). From the stack trace it seems as if the run time environment complains while iterating over the hashmap and not while removing elements from it. Hence, I said wasn't sure if a try/catch would work. Also, my concern is that this would be a hack around what is actually a non-recommended way of working with a HashMap. Obviously, all of us know that none of the methods of the HashMap are actually synchronized and trying to remove elements while iterating over them isnt very appropriate I think.
Changes:
Attachment changed to stackTraceNOrgSource.zip
---------------------------------------------------------------------
For a full history of the issue, see:
http://issues.apache.org/jira/browse/AXIS-1584?page=history
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/AXIS-1584
Here is an overview of the issue:
---------------------------------------------------------------------
Key: AXIS-1584
Summary: ConcurrentModificationException in ManagedMemoryDataSource class
Type: Bug
Status: Unassigned
Priority: Major
Project: Axis
Components:
Basic Architecture
Versions:
1.2 Beta
Assignee:
Reporter: Ananth Krishna
Created: Mon, 4 Oct 2004 9:06 AM
Updated: Wed, 6 Oct 2004 4:50 AM
Environment: Windows XP, SUSE 9.0
Description:
SOAP Attachments, when used in axis 1_2 beta leave a trail of temp files and one of the ways I have found for cleaning all temp files is by using the delete method of the ManagedMemoryDataSource (MMDS) class. It works well for small attachments (of the order of kilobytes) but for anything over a few MB (6/7), there is a java.util.ConcurrentModificationException thrown.
I believe I have a patch for it and have tested that it works. This involves a change in an inner class called InStream of the MMDS class.
The close() method of the InStream class is called by the delete() method of the MMDS class. However, the trouble is the delete() method iterates over a WeakHashMap and the close() method in the InStream class tries to remove elements from this WeakHashMap.
To avoid this race condition, I have created another method closeStream() in the InStream class which, can be invoked by the delete() method in the MMDS class.
Deleting elements from the WeakHashMap isnt affected in anyway as the HashMap is cleared of all it's elements before the method returns. Also, all other methods invoking close() can continue to do so in the same manner as we dont touch that method at all..
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Updated: (AXIS-1584) ConcurrentModificationException in ManagedMemoryDataSource class
Posted by ax...@ws.apache.org.
The following issue has been updated:
Updater: Ananth Krishna (mailto:ak@it-innovation.soton.ac.uk)
Date: Mon, 4 Oct 2004 9:45 AM
Comment:
I tried to include a txt file which would could have shown all unit tests running successfully but unfortunately it seems that unit tests from the cvs head seem to be broken..
Changes:
Attachment changed to bugfixMMDS.zip
---------------------------------------------------------------------
For a full history of the issue, see:
http://issues.apache.org/jira/browse/AXIS-1584?page=history
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/AXIS-1584
Here is an overview of the issue:
---------------------------------------------------------------------
Key: AXIS-1584
Summary: ConcurrentModificationException in ManagedMemoryDataSource class
Type: Bug
Status: Unassigned
Priority: Major
Project: Axis
Components:
Basic Architecture
Versions:
1.2 Beta
Assignee:
Reporter: Ananth Krishna
Created: Mon, 4 Oct 2004 9:06 AM
Updated: Mon, 4 Oct 2004 9:45 AM
Environment: Windows XP, SUSE 9.0
Description:
SOAP Attachments, when used in axis 1_2 beta leave a trail of temp files and one of the ways I have found for cleaning all temp files is by using the delete method of the ManagedMemoryDataSource (MMDS) class. It works well for small attachments (of the order of kilobytes) but for anything over a few MB (6/7), there is a java.util.ConcurrentModificationException thrown.
I believe I have a patch for it and have tested that it works. This involves a change in an inner class called InStream of the MMDS class.
The close() method of the InStream class is called by the delete() method of the MMDS class. However, the trouble is the delete() method iterates over a WeakHashMap and the close() method in the InStream class tries to remove elements from this WeakHashMap.
To avoid this race condition, I have created another method closeStream() in the InStream class which, can be invoked by the delete() method in the MMDS class.
Deleting elements from the WeakHashMap isnt affected in anyway as the HashMap is cleared of all it's elements before the method returns. Also, all other methods invoking close() can continue to do so in the same manner as we dont touch that method at all..
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Updated: (AXIS-1584) ConcurrentModificationException in ManagedMemoryDataSource class
Posted by ax...@ws.apache.org.
The following issue has been updated:
Updater: Ananth Krishna (mailto:ak@it-innovation.soton.ac.uk)
Date: Wed, 6 Oct 2004 2:25 AM
Comment:
diff attached between ManagedMemoryDataSourceorg.java (the original copy) and ManagedMemoryDataSource.java (modified version with the intended fix)..
Changes:
Attachment changed to diff.txt
---------------------------------------------------------------------
For a full history of the issue, see:
http://issues.apache.org/jira/browse/AXIS-1584?page=history
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/AXIS-1584
Here is an overview of the issue:
---------------------------------------------------------------------
Key: AXIS-1584
Summary: ConcurrentModificationException in ManagedMemoryDataSource class
Type: Bug
Status: Unassigned
Priority: Major
Project: Axis
Components:
Basic Architecture
Versions:
1.2 Beta
Assignee:
Reporter: Ananth Krishna
Created: Mon, 4 Oct 2004 9:06 AM
Updated: Wed, 6 Oct 2004 2:25 AM
Environment: Windows XP, SUSE 9.0
Description:
SOAP Attachments, when used in axis 1_2 beta leave a trail of temp files and one of the ways I have found for cleaning all temp files is by using the delete method of the ManagedMemoryDataSource (MMDS) class. It works well for small attachments (of the order of kilobytes) but for anything over a few MB (6/7), there is a java.util.ConcurrentModificationException thrown.
I believe I have a patch for it and have tested that it works. This involves a change in an inner class called InStream of the MMDS class.
The close() method of the InStream class is called by the delete() method of the MMDS class. However, the trouble is the delete() method iterates over a WeakHashMap and the close() method in the InStream class tries to remove elements from this WeakHashMap.
To avoid this race condition, I have created another method closeStream() in the InStream class which, can be invoked by the delete() method in the MMDS class.
Deleting elements from the WeakHashMap isnt affected in anyway as the HashMap is cleared of all it's elements before the method returns. Also, all other methods invoking close() can continue to do so in the same manner as we dont touch that method at all..
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Commented: (AXIS-1584) ConcurrentModificationException in ManagedMemoryDataSource class
Posted by ax...@ws.apache.org.
The following comment has been added to this issue:
Author: Davanum Srinivas
Created: Fri, 15 Oct 2004 6:41 AM
Body:
If i do use an array instead of iterator, will that be enough? want to keep the code clean (avoid duplication, closeStream has everything in close except for the remove)
Object[] array = readers.keySet().toArray();
for (int i = 0; i < array.length; i++) {
Instream stream = (Instream) array[i];
if (null != stream) {
try {
stream.close();
} catch (Exception e) {
}
}
}
readers.clear();
-- dims
---------------------------------------------------------------------
View this comment:
http://issues.apache.org/jira/browse/AXIS-1584?page=comments#action_54189
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/AXIS-1584
Here is an overview of the issue:
---------------------------------------------------------------------
Key: AXIS-1584
Summary: ConcurrentModificationException in ManagedMemoryDataSource class
Type: Bug
Status: Open
Priority: Major
Project: Axis
Components:
Basic Architecture
Versions:
1.2 Beta
Assignee: Davanum Srinivas
Reporter: Ananth Krishna
Created: Mon, 4 Oct 2004 9:06 AM
Updated: Fri, 15 Oct 2004 6:41 AM
Environment: Windows XP, SUSE 9.0
Description:
SOAP Attachments, when used in axis 1_2 beta leave a trail of temp files and one of the ways I have found for cleaning all temp files is by using the delete method of the ManagedMemoryDataSource (MMDS) class. It works well for small attachments (of the order of kilobytes) but for anything over a few MB (6/7), there is a java.util.ConcurrentModificationException thrown.
I believe I have a patch for it and have tested that it works. This involves a change in an inner class called InStream of the MMDS class.
The close() method of the InStream class is called by the delete() method of the MMDS class. However, the trouble is the delete() method iterates over a WeakHashMap and the close() method in the InStream class tries to remove elements from this WeakHashMap.
To avoid this race condition, I have created another method closeStream() in the InStream class which, can be invoked by the delete() method in the MMDS class.
Deleting elements from the WeakHashMap isnt affected in anyway as the HashMap is cleared of all it's elements before the method returns. Also, all other methods invoking close() can continue to do so in the same manner as we dont touch that method at all..
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira