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 "Akitoshi Yoshida (JIRA)" <ax...@ws.apache.org> on 2009/04/01 18:29:13 UTC
[jira] Created: (AXIS-2782) AttachmentPart does not remove its
temporary Axis???.att file, created by ManagedMemoryDataSource, if this
file is created by its flushToDisk method
AttachmentPart does not remove its temporary Axis???.att file, created by ManagedMemoryDataSource, if this file is created by its flushToDisk method
----------------------------------------------------------------------------------------------------------------------------------------------------
Key: AXIS-2782
URL: https://issues.apache.org/jira/browse/AXIS-2782
Project: Axis
Issue Type: Bug
Components: Basic Architecture
Affects Versions: 1.4
Environment: Windows XP
Axis 1.4
Reporter: Akitoshi Yoshida
Fix For: current (nightly)
org.apache.axis.attachments.AttachmentPart has its resource clean up method dispose(), which gets called when the message is garbage collected.
This AttachmentPart uses org.apache.axis.attachments.ManagedMemoryDataSource to hold the attachment content.
The ManagedMemoryDataSource class may create a temporary Axis???.att file and flush the content into this file when there are too many mesages held in memoryh.
When this happens, unfortunately the ManagedMemoryDataSource object's delete() method is not called, when its associated AttachementPart object's dispose() method gets called, as attribute attachmentFile is null as shown in the following code segment:
public synchronized void dispose() {
if (attachmentFile != null) {
javax.activation.DataSource ds = datahandler.getDataSource();
if (ds instanceof ManagedMemoryDataSource) {
((ManagedMemoryDataSource) ds).delete(); //and delete the file
} else {
File f = new File(attachmentFile);
//no need to check for existence here.
f.delete();
}
//set the filename to null to stop repeated use
setAttachmentFile(null);
}
Consequently, this temporary file is not removed.
To fix this problem, I think the ManagedMemoryDataSource's delete method needs to be called independent of the attachmentFile attribute value, as in
public synchronized void dispose() {
javax.activation.DataSource ds = datahandler.getDataSource();
// delete the ManagedMemoryDataSource (may have been flushed into a temp file)
if (ds instanceof ManagedMemoryDataSource) {
((ManagedMemoryDataSource) ds).delete(); //and delete the file
}
if (attachmentFile != null) {
File f = new File(attachmentFile);
//no need to check for existence here.
f.delete();
//set the filename to null to stop repeated use
setAttachmentFile(null);
}
Regards, aki
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (AXIS-2782) AttachmentPart does not remove its
temporary Axis???.att file, created by ManagedMemoryDataSource, if this
file is created by its flushToDisk method
Posted by "James High (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12770429#action_12770429 ]
James High commented on AXIS-2782:
----------------------------------
Is there another bug associated to these temp files not being cleaned up?
> AttachmentPart does not remove its temporary Axis???.att file, created by ManagedMemoryDataSource, if this file is created by its flushToDisk method
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AXIS-2782
> URL: https://issues.apache.org/jira/browse/AXIS-2782
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.4
> Environment: Windows XP
> Axis 1.4
> Reporter: Aki Yoshida
> Fix For: current (nightly)
>
> Attachments: AttachmentPart.zip
>
>
> org.apache.axis.attachments.AttachmentPart has its resource clean up method dispose(), which gets called when the message is garbage collected.
> This AttachmentPart uses org.apache.axis.attachments.ManagedMemoryDataSource to hold the attachment content.
> The ManagedMemoryDataSource class may create a temporary Axis???.att file and flush the content into this file when there are too many mesages held in memoryh.
> When this happens, unfortunately the ManagedMemoryDataSource object's delete() method is not called, when its associated AttachementPart object's dispose() method gets called, as attribute attachmentFile is null as shown in the following code segment:
> public synchronized void dispose() {
> if (attachmentFile != null) {
> javax.activation.DataSource ds = datahandler.getDataSource();
> if (ds instanceof ManagedMemoryDataSource) {
> ((ManagedMemoryDataSource) ds).delete(); //and delete the file
> } else {
> File f = new File(attachmentFile);
> //no need to check for existence here.
> f.delete();
> }
> //set the filename to null to stop repeated use
> setAttachmentFile(null);
> }
> Consequently, this temporary file is not removed.
> To fix this problem, I think the ManagedMemoryDataSource's delete method needs to be called independent of the attachmentFile attribute value, as in
> public synchronized void dispose() {
> javax.activation.DataSource ds = datahandler.getDataSource();
> // delete the ManagedMemoryDataSource (may have been flushed into a temp file)
> if (ds instanceof ManagedMemoryDataSource) {
> ((ManagedMemoryDataSource) ds).delete(); //and delete the file
> }
> if (attachmentFile != null) {
> File f = new File(attachmentFile);
> //no need to check for existence here.
> f.delete();
> //set the filename to null to stop repeated use
> setAttachmentFile(null);
> }
> Regards, aki
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (AXIS-2782) AttachmentPart does not remove its
temporary Axis???.att file, created by ManagedMemoryDataSource, if this
file is created by its flushToDisk method
Posted by "Akitoshi Yoshida (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Akitoshi Yoshida closed AXIS-2782.
----------------------------------
Resolution: Invalid
I created this issue but upon further analysis, It seems attribute attachmentFile will be always set.
So this does not seem to be the cause.
Therefore, I am closing this issue.
aki
> AttachmentPart does not remove its temporary Axis???.att file, created by ManagedMemoryDataSource, if this file is created by its flushToDisk method
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AXIS-2782
> URL: https://issues.apache.org/jira/browse/AXIS-2782
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.4
> Environment: Windows XP
> Axis 1.4
> Reporter: Akitoshi Yoshida
> Fix For: current (nightly)
>
> Attachments: AttachmentPart.zip
>
>
> org.apache.axis.attachments.AttachmentPart has its resource clean up method dispose(), which gets called when the message is garbage collected.
> This AttachmentPart uses org.apache.axis.attachments.ManagedMemoryDataSource to hold the attachment content.
> The ManagedMemoryDataSource class may create a temporary Axis???.att file and flush the content into this file when there are too many mesages held in memoryh.
> When this happens, unfortunately the ManagedMemoryDataSource object's delete() method is not called, when its associated AttachementPart object's dispose() method gets called, as attribute attachmentFile is null as shown in the following code segment:
> public synchronized void dispose() {
> if (attachmentFile != null) {
> javax.activation.DataSource ds = datahandler.getDataSource();
> if (ds instanceof ManagedMemoryDataSource) {
> ((ManagedMemoryDataSource) ds).delete(); //and delete the file
> } else {
> File f = new File(attachmentFile);
> //no need to check for existence here.
> f.delete();
> }
> //set the filename to null to stop repeated use
> setAttachmentFile(null);
> }
> Consequently, this temporary file is not removed.
> To fix this problem, I think the ManagedMemoryDataSource's delete method needs to be called independent of the attachmentFile attribute value, as in
> public synchronized void dispose() {
> javax.activation.DataSource ds = datahandler.getDataSource();
> // delete the ManagedMemoryDataSource (may have been flushed into a temp file)
> if (ds instanceof ManagedMemoryDataSource) {
> ((ManagedMemoryDataSource) ds).delete(); //and delete the file
> }
> if (attachmentFile != null) {
> File f = new File(attachmentFile);
> //no need to check for existence here.
> f.delete();
> //set the filename to null to stop repeated use
> setAttachmentFile(null);
> }
> Regards, aki
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (AXIS-2782) AttachmentPart does not remove its
temporary Axis???.att file, created by ManagedMemoryDataSource, if this
file is created by its flushToDisk method
Posted by "James High (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
James High updated AXIS-2782:
-----------------------------
Comment: was deleted
(was: Is there another bug associated to these temp files not being cleaned up? )
> AttachmentPart does not remove its temporary Axis???.att file, created by ManagedMemoryDataSource, if this file is created by its flushToDisk method
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AXIS-2782
> URL: https://issues.apache.org/jira/browse/AXIS-2782
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.4
> Environment: Windows XP
> Axis 1.4
> Reporter: Aki Yoshida
> Fix For: current (nightly)
>
> Attachments: AttachmentPart.zip
>
>
> org.apache.axis.attachments.AttachmentPart has its resource clean up method dispose(), which gets called when the message is garbage collected.
> This AttachmentPart uses org.apache.axis.attachments.ManagedMemoryDataSource to hold the attachment content.
> The ManagedMemoryDataSource class may create a temporary Axis???.att file and flush the content into this file when there are too many mesages held in memoryh.
> When this happens, unfortunately the ManagedMemoryDataSource object's delete() method is not called, when its associated AttachementPart object's dispose() method gets called, as attribute attachmentFile is null as shown in the following code segment:
> public synchronized void dispose() {
> if (attachmentFile != null) {
> javax.activation.DataSource ds = datahandler.getDataSource();
> if (ds instanceof ManagedMemoryDataSource) {
> ((ManagedMemoryDataSource) ds).delete(); //and delete the file
> } else {
> File f = new File(attachmentFile);
> //no need to check for existence here.
> f.delete();
> }
> //set the filename to null to stop repeated use
> setAttachmentFile(null);
> }
> Consequently, this temporary file is not removed.
> To fix this problem, I think the ManagedMemoryDataSource's delete method needs to be called independent of the attachmentFile attribute value, as in
> public synchronized void dispose() {
> javax.activation.DataSource ds = datahandler.getDataSource();
> // delete the ManagedMemoryDataSource (may have been flushed into a temp file)
> if (ds instanceof ManagedMemoryDataSource) {
> ((ManagedMemoryDataSource) ds).delete(); //and delete the file
> }
> if (attachmentFile != null) {
> File f = new File(attachmentFile);
> //no need to check for existence here.
> f.delete();
> //set the filename to null to stop repeated use
> setAttachmentFile(null);
> }
> Regards, aki
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (AXIS-2782) AttachmentPart does not remove its
temporary Axis???.att file, created by ManagedMemoryDataSource, if this
file is created by its flushToDisk method
Posted by "Akitoshi Yoshida (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXIS-2782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Akitoshi Yoshida updated AXIS-2782:
-----------------------------------
Attachment: AttachmentPart.zip
suggested modification to solve this issue.
> AttachmentPart does not remove its temporary Axis???.att file, created by ManagedMemoryDataSource, if this file is created by its flushToDisk method
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AXIS-2782
> URL: https://issues.apache.org/jira/browse/AXIS-2782
> Project: Axis
> Issue Type: Bug
> Components: Basic Architecture
> Affects Versions: 1.4
> Environment: Windows XP
> Axis 1.4
> Reporter: Akitoshi Yoshida
> Fix For: current (nightly)
>
> Attachments: AttachmentPart.zip
>
>
> org.apache.axis.attachments.AttachmentPart has its resource clean up method dispose(), which gets called when the message is garbage collected.
> This AttachmentPart uses org.apache.axis.attachments.ManagedMemoryDataSource to hold the attachment content.
> The ManagedMemoryDataSource class may create a temporary Axis???.att file and flush the content into this file when there are too many mesages held in memoryh.
> When this happens, unfortunately the ManagedMemoryDataSource object's delete() method is not called, when its associated AttachementPart object's dispose() method gets called, as attribute attachmentFile is null as shown in the following code segment:
> public synchronized void dispose() {
> if (attachmentFile != null) {
> javax.activation.DataSource ds = datahandler.getDataSource();
> if (ds instanceof ManagedMemoryDataSource) {
> ((ManagedMemoryDataSource) ds).delete(); //and delete the file
> } else {
> File f = new File(attachmentFile);
> //no need to check for existence here.
> f.delete();
> }
> //set the filename to null to stop repeated use
> setAttachmentFile(null);
> }
> Consequently, this temporary file is not removed.
> To fix this problem, I think the ManagedMemoryDataSource's delete method needs to be called independent of the attachmentFile attribute value, as in
> public synchronized void dispose() {
> javax.activation.DataSource ds = datahandler.getDataSource();
> // delete the ManagedMemoryDataSource (may have been flushed into a temp file)
> if (ds instanceof ManagedMemoryDataSource) {
> ((ManagedMemoryDataSource) ds).delete(); //and delete the file
> }
> if (attachmentFile != null) {
> File f = new File(attachmentFile);
> //no need to check for existence here.
> f.delete();
> //set the filename to null to stop repeated use
> setAttachmentFile(null);
> }
> Regards, aki
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.