<?xml version="1.0" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugzilla.globus.org/bugzilla/bugzilla.dtd">

<bugzilla version="3.2.3"
          urlbase="http://bugzilla.globus.org/bugzilla/"
          maintainer="bacon@mcs.anl.gov"
>

    <bug>
          <bug_id>4344</bug_id>
          
          <creation_ts>2006-04-13 16:54</creation_ts>
          <short_desc>Globus-url-copy client does not reuse the connection when run in 3rd party mode.</short_desc>
          <delta_ts>2007-05-15 15:12:24</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>GridFTP</product>
          <component>globus-url-copy</component>
          <version>4.0.1</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          
          <priority>P3</priority>
          <bug_severity>blocker</bug_severity>
          <target_milestone>4.0.4</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gaurang Mehta">gmehta@isi.edu</reporter>
          <assigned_to name="Mike Link">mlink@mcs.anl.gov</assigned_to>
          <cc>allcock@mcs.anl.gov</cc>
    
    <cc>bester@mcs.anl.gov</cc>
    
    <cc>shishir@isi.edu</cc>
    
    <cc>vahi@isi.edu</cc>
    
    <cc>voeckler@cs.uchicago.edu</cc>

      

      
          <long_desc isprivate="0">
            <who name="Gaurang Mehta">gmehta@isi.edu</who>
            <bug_when>2006-04-13 16:54:21</bug_when>
            <thetext>So it seems that from the time the -f &lt;file&gt; option for bulk transfers was introduced the client has not been reusing the connection that the server keeps alive for transferring additional files. (I tested this with versions from 3.2, 3.2.1, 4.0 and 4.0.1 as well as the advisory patch for 4.0.1).

How to recreate the scenario.

set the limit of instances to 1 or 2 in the xinetd file for gridftp
create a input file with more the 2 transfers from and to a gridftp server.

invoke the g-u-c from a third site in third party mode 

globus-url-copy -vb -f &lt;input file&gt;

the transfers will start getting an error after the limit in the xinetd has been reached because the server is keeping the initial connections alive for more transfers whereas the client is not reusing them.

The client correctly reuses the connection if the same input file is used to transfer in the no third party mode (-notpt) or if one of the url&apos;s is a file:// url.

This is a major blocker and it would be good if this is fixed and makes it 4.0.2 release.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Mike Link">mlink@mcs.anl.gov</who>
            <bug_when>2006-04-13 17:03:15</bug_when>
            <thetext>Does this happen when the 3pt is between two seperate servers?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Gaurang Mehta">gmehta@isi.edu</who>
            <bug_when>2006-04-13 17:17:47</bug_when>
            <thetext>humm interesting it actually works when the servers are different.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Mike Link">mlink@mcs.anl.gov</who>
            <bug_when>2006-04-13 17:21:21</bug_when>
            <thetext>That&apos;s a known side-affect of the connection caching, which is keyed on the server contact string.  It won&apos;t be changed.  If you really need to transfer files between the same server for testing purposes or whatever, you can avoid the issue by using the hostname for one and the ip address for the other, or something like that; so long as the actual host:port strings are different.

Mike</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Gaurang Mehta">gmehta@isi.edu</who>
            <bug_when>2006-04-13 17:39:22</bug_when>
            <thetext>(In reply to comment #3)
&gt; That&apos;s a known side-affect of the connection caching, which is keyed on the
&gt; server contact string.  

Is this documented somewhere.

It won&apos;t be changed.  If you really need to transfer
&gt; files between the same server for testing purposes or whatever, you can avoid
&gt; the issue by using the hostname for one and the ip address for the other, or
&gt; something like that; so long as the actual host:port strings are different.
&gt; 

I dont agree that a user should be handling this or worry about why his transfers are failing just cause he chose to do a tpt on the same gridftp server.

1) The error thrown does not tell a user why this happens. I spent nearly half a day figuring out why this was happening. 

2) If you can&apos;t map 2 connections in your map then you could in the client automatically use the ip for one connection and the hostname for the other rather then expecting the user to do the same

3) IMO the client should continue working albeit inefficently. If you cant do solution 2 then atleast setting notpt automatically on these transfers will also solve the problem.

_Gaurang


&gt; Mike
&gt; 

(In reply to comment #3)
&gt; That&apos;s a known side-affect of the connection caching, which is keyed on the
&gt; server contact string.  It won&apos;t be changed.  If you really need to transfer
&gt; files between the same server for testing purposes or whatever, you can avoid
&gt; the issue by using the hostname for one and the ip address for the other, or
&gt; something like that; so long as the actual host:port strings are different.
&gt; 
&gt; Mike
&gt; 

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Mike Link">mlink@mcs.anl.gov</who>
            <bug_when>2006-04-13 17:46:04</bug_when>
            <thetext>The failures are due to the server configuration, not the client making multiple connections.  It would fail the same way if you were only making one connection and happened to have two seperate people trying to connect to the server.

I don&apos;t think it was documented, but now it is documented here.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Gaurang Mehta">gmehta@isi.edu</who>
            <bug_when>2006-04-13 18:05:11</bug_when>
            <thetext>let me clarify the situation.

Assume, the limit for server connections is 2.

I can understand if multiple simultaneous g-u-c instances failed with such a server configuration.
 
but this is not the problem i am describing

A single g-u-c should be able to perform multiple transfers from this server to itself in 3rd party mode. 

But this fails.... whereas it should have succeeded, since this particular client holds both connections to the server.

A general application may have no idea that the src and destination urls are on the same host. 

Note : the first transfer succeeds and the subsequent ones are failing. This is not a consistent behaviour. Either all fail (which IMO should not because it can be trivially handled in the client)  or all should succeed (which is what i am rooting for).

I dont want to argue for arguing sake just that a user should not have to handle this.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Mike Link">mlink@mcs.anl.gov</who>
            <bug_when>2006-04-14 13:44:33</bug_when>
            <thetext>I looked at this further and do see a bug that wasn&apos;t expected.  (I apoligize if you said this in your earlier comments and I missed it) The client will create a new connection for each file as I expected, but it never closes the old connections, so it uses far more than the 3 connections that I assumed (the extra one that covered the overlap between opening and closing either the source or dest connection).  I will fix that, and it should give you the result that a 3pt to the same server only takes 2 connections.

This won&apos;t make it into 4.0.2 though, as that had already been close to release earlier in the week.

Mike  </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Gaurang Mehta">gmehta@isi.edu</who>
            <bug_when>2006-04-14 15:31:25</bug_when>
            <thetext>Thanks Mike.

Ok so from what you say i understand that while you cannot/or wont handle the reuse of the connections (if the src-dest are same) atleast it wont take more the 2 connections at any given time. Which is fine if not optimized.

I am a little worried that it wont make it to 4.0.2 since this would have delivered the fix to a wider audience. I have always found putting advisories on binary installs a pain.

 



</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Gaurang Mehta">gmehta@isi.edu</who>
            <bug_when>2006-07-07 17:47:18</bug_when>
            <thetext>Is there a advisory or patch for this i can build against 4.0.2
It would be good to get this patch and the other one you fixed in the same advisory bundle.

-Gaurang</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Mike Link">mlink@mcs.anl.gov</who>
            <bug_when>2006-07-08 01:44:09</bug_when>
            <thetext>There is no fix for this yet, but it would be a seperate advisory.  This is due to a bug in the ftp client library package, not the globus-url-copy package.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Mike Link">mlink@mcs.anl.gov</who>
            <bug_when>2007-02-06 20:36:47</bug_when>
            <thetext>Created an attachment (id=1182)
patch to gridftp/client/source/globus_ftp_client_handle.c

This fixes the connection leak when the source and dest have the same host:port strings.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Mike Link">mlink@mcs.anl.gov</who>
            <bug_when>2007-05-15 15:12:24</bug_when>
            <thetext>This fix was included in the 4.0.4 release.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>1182</attachid>
            <date>2007-02-06 20:36</date>
            <desc>patch to gridftp/client/source/globus_ftp_client_handle.c</desc>
            <filename>4344_4.x.patch</filename>
            <type>text/plain</type>
            <size>2421</size>
            <attacher>mlink@mcs.anl.gov</attacher>
            <data encoding="base64">SW5kZXg6IGdyaWRmdHAvY2xpZW50L3NvdXJjZS9nbG9idXNfZnRwX2NsaWVudF9oYW5kbGUuYwpk
aWZmIC11IGdyaWRmdHAvY2xpZW50L3NvdXJjZS9nbG9idXNfZn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pOworICAgIH0KICAgICBpZigoIWNvbm5lY3RlZCkgfHwgcmVzdWx0ICE9IEdM
T0JVU19TVUNDRVNTKQogICAgIHsKIAkvKiBQcmV0ZW5kIHdlIGNsb3NlZCwgYW5kIGZyZWUgdGhl
IGNvbnRyb2wgaGFuZGxlLiAqLwpAQCAtMTEzOSw3ICsxMTM5LDE2IEBACiAJCWNhY2hlX2VudHJ5
LT50YXJnZXQgPSB0YXJnZXQ7CiAJCUdsb2J1c1RpbWVBYnN0aW1lR2V0Q3VycmVudCh0YXJnZXQt
Pmxhc3RfYWNjZXNzKTsKIAkgICAgfQotCSAgICAKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAg
ICAgIHsKKwkgICAgICAgIC8qIGR1cGxpY2F0ZSB1cmwgaW4gY2FjaGUsIGNhbid0IGFkZCAqLwor
ICAgICAgICAgICAgICAgIGdsb2J1c19pX2Z0cF9jbGllbnRfZGVidWdfcHJpbnRmKDEsIAorICAg
ICAgICAgICAgICAgICAgICAoc3RkZXJyLCAiZ2xvYnVzX2lfZnRwX2NsaWVudF90YXJnZXRfcmVs
ZWFzZSgpICIgCisgICAgICAgICAgICAgICAgICAgICJjYW5ub3QgY2FjaGUgZHVwbGljYXRlIHVy
bCwgZGVsZXRpbmcgdGFyZ2V0XG4iKSk7CisKKyAgICAgICAgICAgICAgICBnbG9idXNfbF9mdHBf
Y2xpZW50X3RhcmdldF9kZWxldGUodGFyZ2V0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAg
IAkgICAgICAgIAogICAgICAgICAgICAgZ2xvYnVzX2lfZnRwX2NsaWVudF9kZWJ1Z19wcmludGYo
MSwgCiAgICAgICAgICAgICAgICAgKHN0ZGVyciwgImdsb2J1c19pX2Z0cF9jbGllbnRfdGFyZ2V0
X3JlbGVhc2UoKSBleGl0aW5nXG4iKSk7CiAK
</data>        

          </attachment>
      

    </bug>

</bugzilla>