curl-library
RE: sftp upload request hangs with a high latency server using multi interface
Date: Mon, 25 Feb 2019 19:13:28 +0000
I tried the sftp_write_nonblock.c example from the libssh2 package modified it as per my sftp server and ran the same test with 500ms latency introduced in the path. I am seeing that sftp write gets stuck in this case too. So, I believe we can say that the issue is not on curl side but on libssh2.
Should I raise this issue with libssh2-devel ?
Further advice would be greatly appreciated.
Thanks,
Ketul
From: Ketul Barot
Sent: Tuesday, February 19, 2019 10:10 AM
To: Daniel Stenberg <daniel_at_haxx.se>; Ketul Barot via curl-library <curl-library_at_cool.haxx.se>
Subject: RE: sftp upload request hangs with a high latency server using multi interface
First of all thank you for helping me debug this issue. As you mentioned about curl timeouts, I would like to say that this issue I am hitting when I abort from the transfer and call curl_multi_remove_handle (as mentioned in my original post) and this is where this gets stucked and does this calling SSH_SESSION_DISCONNECT. I am not sure if curl provides timeouts in this case (curl_multi_remove_handle).
I am not sure if I can build libssh2 application for my device but I can give it a shot.
Thanks,
Ketul
From: Daniel Stenberg <daniel_at_haxx.se<mailto:daniel_at_haxx.se>>
Sent: Saturday, February 16, 2019 10:00 AM
To: Ketul Barot via curl-library <curl-library_at_cool.haxx.se<mailto:curl-library_at_cool.haxx.se>>
Cc: Ketul Barot <kbarot_at_parallelwireless.com<mailto:kbarot_at_parallelwireless.com>>
Subject: RE: sftp upload request hangs with a high latency server using multi interface
On Fri, 15 Feb 2019, Ketul Barot via curl-library wrote:
> I added the timeout function call and it is not working. Meaning, it is not
> timing out after 2 Sec. I believe part of the reason is that the case
> SSH_SESSION_DISCONNECT is called repeatedly and so the timeout function is
> getting called every time.
Ah sorry, I misunderstood. I thought it got stuck in libssh2.
This then sounds like a bug in libssh2 that makes it never really complete the
disconnect procedure. It is curious that this would act any differently
depending on RTT.
(from the a follow-up mail)
> If that is the case can we implement some kind of timeout inside
> *_disconnect function such that if it is not able to flush the data out for
> some reason just disconnect the session.
Well, curl already has a timeout option (or actually, several) so you can
already make it timeout the transfer if this goes on for too long. I don't
think we can detect this situation to know that this is a special known
problematic state that we should avoid that way.
A way to dig further on this problem would be to build an application using
libssh2 directly (without curl) and see if that reproduces this issue, as then
we know where the underlying problem is.
-- / daniel.haxx.se<http://daniel.haxx.se>
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-02-25