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 "Steve Sowerby (JIRA)" <ax...@ws.apache.org> on 2006/10/19 12:17:35 UTC
[jira] Created: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Reading an attachment (slowly) can cause resource deleted error
---------------------------------------------------------------
Key: AXIS-2574
URL: http://issues.apache.org/jira/browse/AXIS-2574
Project: Apache Axis
Issue Type: Bug
Components: Basic Architecture
Affects Versions: 1.2.1
Reporter: Steve Sowerby
When reading the data from an attachment we periodically get the following error:
java.io.IOException: Resource has been deleted.
at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Bjorn Townsend (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXIS-2574?page=comments#action_12443896 ]
Bjorn Townsend commented on AXIS-2574:
--------------------------------------
Steve,
Does this problem still occur when using the latest version of Axis (1.4)?
Thanks,
Bjorn
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: http://issues.apache.org/jira/browse/AXIS-2574
> Project: Apache Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Himanshu Arora (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644662#action_12644662 ]
Himanshu Arora commented on AXIS-2574:
--------------------------------------
Also, can you please pass me the exact path for source code, may be I'm not using the correct source code.
I downloaded version 1.4 final from
http://ws.apache.org/axis/java/releases.html
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Attachments: axis-2574.patch, Call.diff, Call.diff, Call.java
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Santu Ghosh (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12741610#action_12741610 ]
Santu Ghosh commented on AXIS-2574:
-----------------------------------
I have the axis-2574.patch downloaded, also I have Axis1.4.jar. Now I want to replace the old Call.java by new Call.java. The following import class are not found. Do I need to add any depenadnt jar?
import org.apache.axis.wsa.WSAConstants ;
import org.apache.axis.wsa.MIHeader ;
import org.apache.axis.wsa.EndpointReference ;getting
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Assignee: Jochen Wiedmann
> Attachments: axis-2574.patch, Call.diff, Call.diff, Call.java
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Jochen Wiedmann (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jochen Wiedmann updated AXIS-2574:
----------------------------------
Attachment: axis-2574.patch
Updated version of Rodrigos patch.
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Attachments: axis-2574.patch, Call.diff, Call.diff, Call.java
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Updated: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Rodrigo Ruiz (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rodrigo Ruiz updated AXIS-2574:
-------------------------------
Attachment: Call.java
I add the patched class, just in case.
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Attachments: Call.diff, Call.diff, Call.java
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Updated: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Rodrigo Ruiz (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rodrigo Ruiz updated AXIS-2574:
-------------------------------
Attachment: Call.diff
The problem is that the Call object finalization triggers a chain of finalisations that ends in the disposal of all the AttachmentPart instances in the response message (among other things). When finalised, AttachmentPart closes the internal datahandler, and deletes the file associated. This last step is the source for the error. The file is deleted from the filesystem while it is being read.
This patch uses a WeakHashMap to keep a hard reference to the Call instance from where the attachments were obtained. This way, the Call instance will not be garbage collected while the attachments are being processed.
I am not sure this is an all-cases solution, but it does work for me.
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Attachments: Call.diff
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Ajay Shenoy (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12636362#action_12636362 ]
Ajay Shenoy commented on AXIS-2574:
-----------------------------------
I am trying to apply the patch but I am getting the following line
$ pwd
/home/ShenoA/patch/axis-src-1_4/axis-1_4/src/org/apache/axis/client
$ patch -d . < /home/ShenoA/patch/Call.diff
Looks like a unified context diff.
I can't seem to find a patch in there anywhere.
I am new to applying patches, Can someone tell me what I am doing wrong and what is the correct command ?
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Attachments: Call.diff, Call.diff
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Issue Comment Edited: (AXIS-2574) Reading an attachment
(slowly) can cause resource deleted error
Posted by "Santu Ghosh (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12741610#action_12741610 ]
Santu Ghosh edited comment on AXIS-2574 at 8/10/09 3:59 PM:
------------------------------------------------------------
I have the axis-2574.patch downloaded, also I have Axis1.4.jar. Now I want to replace the old Call.java by new Call.java. The following import class are not found. Do I need to add any dependant jar?
import org.apache.axis.wsa.WSAConstants ;
import org.apache.axis.wsa.MIHeader ;
import org.apache.axis.wsa.EndpointReference ;
Can anyone please help me out here?
was (Author: santughosh):
I have the axis-2574.patch downloaded, also I have Axis1.4.jar. Now I want to replace the old Call.java by new Call.java. The following import class are not found. Do I need to add any depenadnt jar?
import org.apache.axis.wsa.WSAConstants ;
import org.apache.axis.wsa.MIHeader ;
import org.apache.axis.wsa.EndpointReference ;getting
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Assignee: Jochen Wiedmann
> Attachments: axis-2574.patch, Call.diff, Call.diff, Call.java
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Jochen Wiedmann (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jochen Wiedmann resolved AXIS-2574.
-----------------------------------
Resolution: Fixed
Assignee: Jochen Wiedmann
Applied to the Axis trunk.
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Assignee: Jochen Wiedmann
> Attachments: axis-2574.patch, Call.diff, Call.diff, Call.java
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Himanshu Arora (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642137#action_12642137 ]
Himanshu Arora commented on AXIS-2574:
--------------------------------------
Hi Rodrigo,
I tried the options you mentioned above but still i m getting same error, is it possible for you to pass me the jars you produced so that i can check the issue with them as well.
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Attachments: Call.diff, Call.diff, Call.java
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Rodrigo Ruiz (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12636573#action_12636573 ]
Rodrigo Ruiz commented on AXIS-2574:
------------------------------------
The patch is for the svn trunk version of Axis 1.4. I did not tested with the 1.4 release branch.
I have just checked the patch (the one of 10KB size) in a fresh working copy, and it worked for me. Make sure you apply the patch from the same directory where Call.java is.
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Attachments: Call.diff, Call.diff
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Himanshu Arora (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644661#action_12644661 ]
Himanshu Arora commented on AXIS-2574:
--------------------------------------
Hi Jochen,
I'm new to patching, I did following but got exception.
D:\Projects\axis-src-1_4\axis-1_4\src\org\apache\axis\client>patch -d . -u -N --verbose <axis-2574.patch
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: src/org/apache/axis/client/Call.java
|===================================================================
|--- src/org/apache/axis/client/Call.java (revision 708095)
|+++ src/org/apache/axis/client/Call.java (working copy)
--------------------------
Patching file Call.java using Plan A...
Reversed (or previously applied) patch detected! Skipping patch.
Hunk #1 ignored at 62.
1 out of 1 hunk ignored -- saving rejects to file Call.java.rej
Hmm...missing header for unified diff at line 15 of patch
The next patch looks like a unified diff to me...
can't find file to patch at input line 15
Perhaps you should have used the -p or --strip option?
File to patch: Call.java
Patching file Call.java using Plan A...
Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
------------------------------------------------------
Please help...
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Attachments: axis-2574.patch, Call.diff, Call.diff, Call.java
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Edith Birrer (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXIS-2574?page=comments#action_12445880 ]
Edith Birrer commented on AXIS-2574:
------------------------------------
I also have this problem (using Axis 1.3, I cannot upgrade to Axis 1.4 because of problem AXIS-2585).
It blocks an important project of ours. Any idea if and when this problem will be fixed?
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: http://issues.apache.org/jira/browse/AXIS-2574
> Project: Apache Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Rune Slinning (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12747676#action_12747676 ]
Rune Slinning commented on AXIS-2574:
-------------------------------------
I am using Axis 1.4 and my project is halted due to this issue.
I'm new to patching. Does anyone have a binary axis.jar (1_4) where this patch is incorporated, or could anyone tell me how I can path it myself.
Please help me out.
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Assignee: Jochen Wiedmann
> Attachments: axis-2574.patch, Call.diff, Call.diff, Call.java
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Ajay Shenoy (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12636404#action_12636404 ]
Ajay Shenoy commented on AXIS-2574:
-----------------------------------
I think this diff doesnt work for the final axis1.4 src. Can you please guide me?
Thanks
Ajay
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Attachments: Call.diff, Call.diff
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Updated: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Rodrigo Ruiz (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rodrigo Ruiz updated AXIS-2574:
-------------------------------
Attachment: Call.diff
Sorry, the previous patch was broken and led to compile errors. This is the correct one.
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Attachments: Call.diff, Call.diff
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Rodrigo Ruiz (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12628018#action_12628018 ]
Rodrigo Ruiz commented on AXIS-2574:
------------------------------------
The issue is not fixed. The patch I uploaded is for Axis 1.4.
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Attachments: Call.diff, Call.diff
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Ajay Shenoy (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12636373#action_12636373 ]
Ajay Shenoy commented on AXIS-2574:
-----------------------------------
I used the GNUWin32 patch tool to do this and got the following error
C:\Documents and Settings\shenoa\Desktop\patch>patch -u -N --verbose <Call.diff
Hmm... Looks like a unified diff to me...
(Stripping trailing CRs from patch.)
The text leading up to this was:
--------------------------
|Index: Call.java
|===================================================================
|--- Call.java (revision 530044)
|+++ Call.java (working copy)
--------------------------
Patching file Call.java using Plan A...
Hunk #1 succeeded at 1.
Hunk #2 succeeded at 25.
Hunk #3 succeeded at 63.
Hunk #4 succeeded at 86 (offset -1 lines).
Hunk #5 succeeded at 94 with fuzz 1 (offset -1 lines).
Hunk #6 succeeded at 232 (offset -3 lines).
Hunk #7 FAILED at 282.
Hunk #8 succeeded at 309 (offset -3 lines).
Hunk #9 succeeded at 339 (offset -3 lines).
Hunk #10 succeeded at 1055 (offset -17 lines).
Hunk #11 succeeded at 1351 (offset -17 lines).
Hunk #12 succeeded at 1452 (offset -17 lines).
Hunk #13 succeeded at 1461 (offset -17 lines).
Hunk #14 succeeded at 1596 (offset -17 lines).
Hunk #15 FAILED at 1825.
Hunk #16 FAILED at 1835.
Hunk #17 FAILED at 1870.
Hunk #18 FAILED at 1912.
Hunk #19 succeeded at 1872 (offset -107 lines).
Hunk #20 succeeded at 1907 (offset -107 lines).
Hunk #21 succeeded at 2071 (offset -107 lines).
Hunk #22 FAILED at 2205.
Hunk #23 succeeded at 2559 (offset -116 lines).
Hunk #24 succeeded at 2612 (offset -116 lines).
Hunk #25 succeeded at 2734 (offset -116 lines).
Hunk #26 succeeded at 2765 (offset -116 lines).
Hunk #27 succeeded at 2888 (offset -88 lines).
Hunk #28 succeeded at 2947 (offset -88 lines).
Hunk #29 FAILED at 3100.
Hunk #30 FAILED at 3133.
Hunk #31 FAILED at 3176.
9 out of 31 hunks FAILED -- saving rejects to file Call.java.rej
done
Any thoughts?
Your help will be really appreciated.
Thanks in advance
-Ajay
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Attachments: Call.diff, Call.diff
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Richard Ziegler (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601169#action_12601169 ]
Richard Ziegler commented on AXIS-2574:
---------------------------------------
I'm commenting to confirm that the patch worked for me. Thanks!
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Attachments: Call.diff, Call.diff
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Commented: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Ajay Shenoy (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12628012#action_12628012 ]
Ajay Shenoy commented on AXIS-2574:
-----------------------------------
We are getting the same error as above.
Can someone confirm if it is fixed in Axis 1.4 or we ourselves have to modify the Call.java class as mentioned above to fix this issue?
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Attachments: Call.diff, Call.diff
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
[jira] Issue Comment Edited: (AXIS-2574) Reading an attachment
(slowly) can cause resource deleted error
Posted by "Santu Ghosh (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12741610#action_12741610 ]
Santu Ghosh edited comment on AXIS-2574 at 8/10/09 4:06 PM:
------------------------------------------------------------
I have the axis-2574.patch downloaded, also I have Axis1.4.jar. In the new Call.java I can see following imports, and giving compilation error because new imported classes are not found. Do I need to add any dependant jars?
import org.apache.axis.wsa.WSAConstants ;
import org.apache.axis.wsa.MIHeader ;
import org.apache.axis.wsa.EndpointReference ;
Can anyone please help me out here?
was (Author: santughosh):
I have the axis-2574.patch downloaded, also I have Axis1.4.jar. Now I want to replace the old Call.java by new Call.java. The following import class are not found. Do I need to add any dependant jar?
import org.apache.axis.wsa.WSAConstants ;
import org.apache.axis.wsa.MIHeader ;
import org.apache.axis.wsa.EndpointReference ;
Can anyone please help me out here?
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: https://issues.apache.org/jira/browse/AXIS-2574
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
> Assignee: Jochen Wiedmann
> Attachments: axis-2574.patch, Call.diff, Call.diff, Call.java
>
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (AXIS-2574) Reading an attachment (slowly) can
cause resource deleted error
Posted by "Edith Birrer (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXIS-2574?page=comments#action_12447835 ]
Edith Birrer commented on AXIS-2574:
------------------------------------
Concerning the problem with the deleted resources, I found something which could give a hint about what a solution could be.
By the way, this is now in Axis 1.4 . (I found a way around the problem mentioned in AXIS-2585 - used the missing class "stolen" from Axis 1.3).
To track the creation and deletion of the attachments, I used remote debugging from Eclipse into Tomcat and set a breakpoint in AttachmentPart.<init>(DataHandler) and one in AttachmentPart.dispose() [or in AttachmentImpl.dispose() ]. Additionally I watched the data flow in SOAP-Monitor.
For the findings it is important to understand the environment; here a short description.
I have server which runs two webservices:
-- The "main" webservice receives requests which contain a data file (in a DataHandler) and stores them in a queue. (It can also deliver the result of the request back to the caller, but this is not important for now).
-- The "queue" webservice is called by "workers" which use it to take requests from the queue, work on them and give the result back to the queue.
So the the story of a request is as follows:
1. The request object (containing a DataHandler) is sent to the webservice: Axis transfers the attachment and then may finalize (and delete) it.
2. A worker has nothing to do and requests work from the queue. In the response he receives the request object (still containing the DataHandler), so Axis again transfers the attachment (but this time it is a send operation and not a receive).
3. The worker works on it, creates two result files and attaches them to the request object. Then the whole thing is transferred back to the queue: Axis again transfers all attachments (now 3) and then may finalize them.
AttachmentsImpl has a map of AttachmentPart. Whenever a message is disposed, all its Attachments are disposed. The chain is:
MessageContext.dispose() -> Message.dispose() -> AttachmentsImpl.dispose()
and the latter loops over all AttachmentPart and disposes them.
Now the interesting thing:
Step 1 of the above creates an entry with the id of the DataHandler, and after transfer, the AttachmentPart will be deleted. The same object used in step 1 comes back in step 3. It still contains the same DataHandler, untouched by the application. In addition it contains 2 new attachments. Thus, step 3 has to transfer 3 attachments. However, for the first Attachment, the corresponding AttachmentPart has been deleted in step 1! Axis somehow does not create a new one, but just finds that the file (the file in the AxisAttachments directory) has been deleted (which is correct).
I tried the following: As there is no reason to give back in step 3 the original data from step 1, I changed the worker: after storing the data file, it sets the DataHandler field in the request object to null. So in step 3, only the two new attachments have to be transferred. This works, I never get the "Resource has been deleted" message!!! (unless I use the debugger to stop all calls to AttachmentPart.<init>(DataHandler) and only let through the calls to AttachmentPart.dispose() - but in reality this should not happen...)
So to me it looks like a DataHandler can only be transferred once with Axis. If you need to transfer the same file again, you have to create a new DataHandler. Or better, check if you re-transfer files which you don't really need to and eliminate that.
Peggy, maybe this is also the case in your application?
A DataHandler object can only be transferred once with Axis - I wonder if this is the intended behaviour? If it is, shouldn't it be mentioned somewhere? Or if it isn't, why does Axis not create again an AttachmentPart for it?
> Reading an attachment (slowly) can cause resource deleted error
> ---------------------------------------------------------------
>
> Key: AXIS-2574
> URL: http://issues.apache.org/jira/browse/AXIS-2574
> Project: Apache Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.2.1
> Reporter: Steve Sowerby
>
> When reading the data from an attachment we periodically get the following error:
> java.io.IOException: Resource has been deleted.
> at org.apache.axis.attachments.ManagedMemoryDataSource$Instream.read(ManagedMemoryDataSource.java:688)
> Having run this throught a debugger and had a brief look at the code it seems to me there is a race condition of sorts.
> The MemoryManagedDataSource that provides the InputStream has been marked as deleted by the finalize method of AttachmentPart.
> So basically if the client doesn't read off the attachment fast enough then the writer will have finished and the AttachmentPart gets finalized and blam, you've got a deleted MemoryManagedDataSource.
> I'm not sure what the best fix is. Perhaps the deletion should actually be some reference count rather than a simple boolean. That way the MemoryManagedDataSource gets deleted once all the writers and readers are done? Although perhaps then there would be an issue if the client was very slow to even open the attachment?
--
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org