Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0038188 | Openbravo ERP | A. Platform | public | 2018-03-21 11:29 | 2018-03-23 21:22 |
|
Reporter | caristu | |
Assigned To | caristu | |
Priority | high | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | 3.0PR18Q2 | |
Merge Request Status | |
Review Assigned To | alostale |
OBNetwork customer | |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0038188: Concurrency problem when downloading attachments with attachment methods that downloads temp files |
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. |
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 [^] |
Proposed Solution | |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | defect | 0038450 | | closed | caristu | Allow to download attachments in temporary files using the attachment name without concurrency problems | blocks | design defect | 0034664 | | acknowledged | Triage Platform Base | multi thread unsafeties |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2018-03-21 11:29 | caristu | New Issue | |
2018-03-21 11:29 | caristu | Assigned To | => platform |
2018-03-21 11:29 | caristu | Modules | => Core |
2018-03-21 11:29 | caristu | Triggers an Emergency Pack | => No |
2018-03-21 11:29 | caristu | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=16902#r16902 |
2018-03-21 11:29 | caristu | Assigned To | platform => caristu |
2018-03-21 13:11 | caristu | Description Updated | bug_revision_view_page.php?rev_id=16904#r16904 |
2018-03-21 13:56 | hgbot | Checkin | |
2018-03-21 13:56 | hgbot | Note Added: 0103387 | |
2018-03-21 13:56 | hgbot | Status | new => resolved |
2018-03-21 13:56 | hgbot | Resolution | open => fixed |
2018-03-21 13:56 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/922ddf36e81c56a1320e2d9b66ecd6c54988be5c [^] |
2018-03-21 13:56 | caristu | Review Assigned To | => alostale |
2018-03-22 12:02 | alostale | Relationship added | blocks 0034664 |
2018-03-22 15:09 | hudsonbot | Checkin | |
2018-03-22 15:09 | hudsonbot | Note Added: 0103431 | |
2018-03-23 08:52 | hgbot | Checkin | |
2018-03-23 08:52 | hgbot | Note Added: 0103456 | |
2018-03-23 09:05 | alostale | Note Added: 0103457 | |
2018-03-23 09:05 | alostale | Status | resolved => closed |
2018-03-23 09:05 | alostale | Fixed in Version | => 3.0PR18Q2 |
2018-03-23 21:22 | hudsonbot | Checkin | |
2018-03-23 21:22 | hudsonbot | Note Added: 0103477 | |
2018-04-25 15:48 | caristu | Relationship added | related to 0038450 |
Notes |
|
(0103387)
|
hgbot
|
2018-03-21 13:56
|
|
Repository: erp/devel/pi
Changeset: 922ddf36e81c56a1320e2d9b66ecd6c54988be5c
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Mar 21 13:51:33 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/922ddf36e81c56a1320e2d9b66ecd6c54988be5c [^]
fixes issue 38188: avoid concurrency problems in attachment download
When using an attachment method that creates a temporary (copy) of an attached file about to be downloaded, that copy is deleted once it has been served. Using the attachment name as the name for this "copied" file can cause concurrency problems when the same attachment is downloaded at the same time by different users.
To avoid this poblem, now the file to be served will be created in the server with the same name of the file returned by the attachment method. Note that this change does not affect to the name of the file that will be downloaded in the client, which still will be the name of the attachment.
---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachImplementationManager.java
---
|
|
|
|
|
|
(0103456)
|
hgbot
|
2018-03-23 08:52
|
|
Repository: erp/devel/pi
Changeset: adf483c880661502b713d122fc638a2e9a26b568
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Fri Mar 23 08:51:41 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/adf483c880661502b713d122fc638a2e9a26b568 [^]
related to issue 38188: use NIO API to copy the file into the output stream
---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/attachment/AttachImplementationManager.java
---
|
|
|
|
|
|
|
|