curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: sftp upload request hangs with a high latency server using multi interface

From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 14 Feb 2019 17:26:14 +0100 (CET)

On Thu, 14 Feb 2019, Ketul Barot via curl-library wrote:

> I am facing a hang followed by SIGABRT when trying to upload a file using
> sftp protocol.

SIGABRT ? That's highly unexpected. What's causing that? Can you strace and
figure out?

> With the same setup, occasionally the transfer gets hung at
> curl_multi_remove_handle. Upon enabling the CURLOPT_VERBOSE option I found
> that the curl get hung at "SFTP 0x1c739e8 state change from
> SSH_SFTP_SHUTDOWN to SSH_SESSION_DISCONNECT".

That log would be this line:

https://github.com/curl/curl/blob/539d17b0de923b9a122f551fddac2a82ed95d9b2/lib/ssh.c#L2340

It would then move on to the case for the DISCONNECT state:

https://github.com/curl/curl/blob/539d17b0de923b9a122f551fddac2a82ed95d9b2/lib/ssh.c#L2568

Given your description, it sounds as if one of those calls to libssh2 then
gets stuck. Maybe you can add more logging around those invokes to figure out
if that is indeed the case.

If it is indeed a libssh2 function that blocks, then I'm afraid the problem is
most likely in libssh2 and not in curl itself... but even if so, just being
able to identify that would be a step forward. Then we can just skip into that
library and figure out why it hangs there!

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2019-02-14