Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 165947

Summary: Incomplete file transfer from remote to local system
Product: z_Archived Reporter: Michael Spivak-Baranov <Michael.Spivak.Baranov>
Component: TPTPAssignee: Igor Alelekov <igor.alelekov>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: igor.alelekov, karla.callaghan, kevin.p.o'leary, samwai
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: closed460
Attachments:
Description Flags
the patch fixes incorrect calculation of record boundary none

Description Michael Spivak-Baranov CLA 2006-11-27 12:55:20 EST
Transferring some files sometimes is not completed. Example:

remotePath = "/tmp/111/NNECBuildLog.log"
localPath = "d:\temp\444\NNECBuildLog.log"
The size of the file is 2931 bytes.

I'm getting the file from the remote computer. The method getFile hangs when 2560 bytes has been copied.

If the localPath is changed to "d:\temp\444\1\NNECBuildLog.log", everything works fine.

My platform for the AC: Red Hat Enterprise Linux ES release 3 (Taroon Update 6)
My platform for the client in Java: Windows XP, Java Sun 1.4.2_13
Comment 1 Igor Alelekov CLA 2006-12-11 07:20:20 EST
Created attachment 55385 [details]
the patch fixes incorrect calculation of record boundary

Under some conditions last chunk of data isn't transfered
due to incorrect calculation of record boundary.
The suggested patch fixes this calculation.
Comment 2 Karla Callaghan CLA 2006-12-13 16:55:33 EST
Making Igor owner.

Adding Samson to CC as this patch is in a lib shared with the RAC.

Samson, please review and commit.
Comment 3 Samson Wai CLA 2007-03-01 12:29:05 EST
Hi Igor. Can you describe why the file transfer is related to the shared memory code?
Comment 4 Igor Alelekov CLA 2007-03-02 02:20:22 EST
Samson,
File transfer agent uses shared memory to send/receve files.
And under some conditions last data block isn't sent to AC and file transfer hangs.
Comment 5 Samson Wai CLA 2007-03-05 10:44:40 EST
Hi Igor. So this is not related to the java-based file server in the backward compatibility layer? Since I think the java-based one does not use shared memory at all.
Comment 6 Igor Alelekov CLA 2007-03-05 10:49:32 EST
(In reply to comment #5)
> Hi Igor. So this is not related to the java-based file server in the backward
> compatibility layer? Since I think the java-based one does not use shared
> memory at all.

Yes, It is not related to the java-based file server in the backward compatibility layer.
It is related with data channels via shared memory in new AC.
Comment 7 Samson Wai CLA 2007-03-05 12:34:29 EST
Hi Igor. I want to understand a bit further. This same piece of code has been used for many years for processing profiling data and we have not seen any bug reported. Is it true that the problem can only be uncovered when the record length perfectly alignes with the buffer (in the case it meets the ">=" condition") and it somehow mess up the calculation thereafter?

Maybe it is just my stupid concern but I just don't want this fix to cause any regression :-)
Comment 8 Igor Alelekov CLA 2007-03-06 08:05:18 EST
Hi Samson. If we got a whole record it should be flushed. However currently, if data length exactly equals buffer length, data are held off as in the case of incompleted record. It is not such important in profiling since in data flow next data block will push deferred one. In file transfer if last data block is held, transfer hangs. I've tested the patch on various platforms with pi and ti agents. No regression was found.
Comment 9 Samson Wai CLA 2007-03-06 09:38:43 EST
Thanks Igor for explaining the fix. I am OK with the fix and will commit to 4.4 shortly.
Comment 10 Samson Wai CLA 2007-03-06 09:40:09 EST
BTW I can see that there are 3 different places in the code which have the same ">=" check. Should I also update them as well?
Comment 11 Igor Alelekov CLA 2007-03-07 02:26:53 EST
It seems that data could be defered in the first place only (in dataToFuncProcessor()).
I don't see a problem with the other places.
Comment 12 Samson Wai CLA 2007-03-07 15:34:16 EST
Fix reviewed and committed into CVS head stream at 2007/03/07 15:27 EST.

Igor, please mark the bug as resolved. Thanks.
Comment 13 Igor Alelekov CLA 2007-03-07 16:53:55 EST
Marked as resolved, thanks :)
Comment 14 Paul Slauenwhite CLA 2009-06-30 12:04:59 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since this enhancement/defect has been resolved and unverified for more than 1 year and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.