[Bug 774485] New: Sometimes upload hangs in case the connection was cut between the client and the HTTP server

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Tue Nov 15 17:58:32 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=774485

            Bug ID: 774485
           Summary: Sometimes upload hangs in case the connection was cut
                    between the client and the HTTP server
    Classification: Platform
           Product: GStreamer
           Version: 1.x
                OS: other
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gst-plugins-bad
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: Imre.Eors at axis.com
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

Created attachment 339955
  --> https://bugzilla.gnome.org/attachment.cgi?id=339955&action=edit
PATCH: Time out in case transfer speed in bytes per second stay below
CURLOPT_LOW_SPEED_LIMIT during CURLOPT_LOW_SPEED_TIME

Image upload hangs in case the connection was cut between the client and the
HTTP server.

In function handle_transfer we are calling gst_poll_wait with 90 seconds time
out and afterward curl_multi_perform to write the data into the socket send
buffer.

We have two cases:
1. Function gst_poll_wait which calls ppoll set POLLOUT in revents field, which
means the socket is writable. Then curl_multi_perform fill the socket send
buffer.
During the upload we cut the connection between the client and the server.
I mean we pull out the cable, physically terminate the connection between the
client and the server. In case the socket send buffer level is above the
low-water mark, then ppoll after 90 seconds throws a time out. Time out happens
because the socket is not writable during 90 seconds.

2. Function gst_poll_wait, which calls ppoll set POLLOUT in revents field,
which means the socket is writable. Afterward curl_multi_perform fill the
socket send buffer.
Let's say that curl_multi_perform sent all the data and now waiting for the
transfer to finish. The kernel sending out the data from the socket send
buffer.
When the socket send buffer level goes below the low-water mark we cut the
connection between the client and the server.I mean we pull out the cable,
physically terminate the connection between the client and the server.
In this case we stuck in the while loop, where we call gst_poll_wait and
gst_multi_perform alternately.
Function ppoll set only POLLOUT in revents field, because we can write more
data to the socket send buffer. Then function curl_multi_perform is called,
which has already copied all the data into the socket send buffer and waiting
for the transfer to finish.


During the upload in case we stop the Apache server, then ppoll set immediately
POLLHUP in revents field.
Despite of this fact if we cut the connection between the client and the server
physically, POLLHUP is not set by ppoll.

In the light of the above information, to fix this upload stuck issue, we set 
CURLOPT_LOW_SPEED_LIMIT and CURLOPT_LOW_SPEED_TIME. 
Please find the patch attached.

We are using the below setup:
client---switch---PC(NAT)---PROXY---HTTP server
Connection is cut between the PC and the PROXY.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list