Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Revisions: Issue #38188 Back to Issue ]
Summary 0038188: Concurrency problem when downloading attachments with attachment methods that downloads temp files
Revision 2018-03-21 13:11 by caristu
Description When downloading attachments with attachment methods that downloads temp files, the temporary file generated for an attachment is always generated with the attachment name.

This can cause problems if the same attachment is downloaded by different clients at the same time, as the temporary file is deleted at the end of the processes. Thus, if the temporary file is deleted and there is a client which is downloading the same attachment at that very same moment, it could result in the downloading of an empty/corrupted file.
Revision 2018-03-21 11:29 by caristu
Description When downloading attachments with attachment methods that downloads temp files, the temporary file generated for an attachment is always generated with the attachment name.

This can cause problems if the same attachment is downloaded by different clients at the same time, as the temporary file is deleted at the end of the processes. Thus, if the temporary file is deleted and there is a client which is downloading the same attachment at that very same moment, the downloaded file obtained may be wrong.
Revision 2018-03-21 11:29 by caristu
Steps To Reproduce Artificial test.

0) Install the following module[1] which contains an attachment method which uses temporary files on download. Configure it as the attachment method of the client.

1) Login in Openbravo. Create an attachment in any window.
2) In eclipse, put a breakpoint in this line: https://code.openbravo.com/erp/devel/pi/file/tip/modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachImplementationManager.java#l267 [^]
3) Download the attachment. Stop at the breakpoint.
4) Login in Openbravo using another browser tab.
5) In eclipse, put a breakpoint in this line: https://code.openbravo.com/erp/devel/pi/file/tip/modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachImplementationManager.java#l264 [^]
6) Download the same attachment of step 3. Stop at the breakpoint.
7) Continue the thread stopped at step 3 --> The attachment is correctly downloaded
8) Continue with the thread stopped at step 6 --> ERROR. The attachment is not correctly downloaded (an empty file is downloaded)

[1] https://code.openbravo.com/erp/pmods/org.openbravo.service.integration.amazon.s3 [^]
Revision 2018-03-21 11:29 by caristu
Steps To Reproduce Artificial test.

0) Install the following module[1] which contains an attachment method which uses temporary files on download. Configure it as the attachment method of the client.

1) Login in Openbravo. Create an attachment in any window.
2) In eclipse, put a breakpoint in this line: https://code.openbravo.com/erp/devel/pi/file/tip/modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachImplementationManager.java#l267 [^]
3) Download the attachment. Stop at the breakpoint.
4) Login in Openbravo using another browser tab.
5) In eclipse, put a breakpoint in this line: https://code.openbravo.com/erp/devel/pi/file/tip/modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachImplementationManager.java#l264 [^]
6) Download the same attachment of step 3. Stop at the breakpoint.
7) Continue the thread stopped at step 3 --> The attachment is correctly downloaded
8) Continue with the thread stopped at step 6 --> ERROR. The attachment is not correctly downloaded (an empty file is downloaded)




[1] https://code.openbravo.com/erp/pmods/org.openbravo.service.integration.amazon.s3 [^]


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker