<div dir="ltr"><div>Hi Robert!</div><div><br></div><div>Well it somewhat unexpected that it returns an undocumented value. It might be that the correction made to fix a timing bug in the FTP application, that<br></div><div>was exposed by TLS optimizations when running FTP over TLS, uncovered some other timing bug. Most of the FTP code is very old and I wished for the gen_statem behavior while fixing the bug I just mentioned, so I would not be very surprised if there are more race conditions in that code. </div><div><br></div><div>Regards Ingela Erlang/OTP team </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Den mån 8 juli 2019 kl 18:11 skrev Robert Raschke <<a href="mailto:rtrlists@googlemail.com" target="_blank">rtrlists@googlemail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I have code that matches on {ok, Result} and {error, Reason} tuples coming from calls to ftp:ls/2 and ftp:recv_bin/2 (on 21.1, ftp-1.0.1) and upgrading to 21.3 (ftp-1.0.2) sometimes returns a simple ok on those calls. This is surprising.</div><div><br></div><div>





<p class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-s1" style="font-variant-ligatures:no-common-ligatures">15> f().</span></p>
<p class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-s1" style="font-variant-ligatures:no-common-ligatures">ok</span></p>
<p class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-s1" style="font-variant-ligatures:no-common-ligatures">16> {ok, FTP} = ftp:open("somesite"), ok = ftp:user(FTP, "someuser", "somepwd"), timer:sleep(100), R = ftp:ls(FTP, "/somefolder/*"), ftp:close(FTP), R.</span></p>
<p class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-s1" style="font-variant-ligatures:no-common-ligatures">{ok,"-rw-r--r--<span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-Apple-converted-space">    </span>1 2001 <span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-Apple-converted-space">      </span>2001 <span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-Apple-converted-space">          </span>174993 Jul<span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-Apple-converted-space">  </span>8 17:16 ..."}</span></p>
<p class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-s1" style="font-variant-ligatures:no-common-ligatures">17> f().</span></p>
<p class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-s1" style="font-variant-ligatures:no-common-ligatures">ok</span></p>
<p class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-s1" style="font-variant-ligatures:no-common-ligatures">18> {ok, FTP} = ftp:open("somesite"), ok = ftp:user(FTP, "someuser", "somepwd"), timer:sleep(100), R = ftp:ls(FTP, "/somefolder/*"), ftp:close(FTP), R.</span></p>
<p class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-s1" style="font-variant-ligatures:no-common-ligatures">ok</span></p>
<p class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-s1" style="font-variant-ligatures:no-common-ligatures">19><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-Apple-converted-space"> </span></span></p><p class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-Apple-converted-space"><br></span></span></p><p class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-Apple-converted-space"><font face="arial, sans-serif">What might be the reason for this? And is this expected?</font></span></span></p><p class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-Apple-converted-space"><font face="arial, sans-serif"><br></font></span></span></p><p class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-Apple-converted-space"><font face="arial, sans-serif">Cheers,</font></span></span></p><p class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-Apple-converted-space"><font face="arial, sans-serif">Robby</font></span></span></p><p class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0)"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="m_-2440304017121086459gmail-m_-7509775641434017626gmail-Apple-converted-space"><font face="arial, sans-serif"><br></font></span></span></p></div></div>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div></div>