After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 749971 - gnome-software doesn't close "connections" properly
gnome-software doesn't close "connections" properly
Status: RESOLVED FIXED
Product: gnome-software
Classification: Applications
Component: General
3.16.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Software maintainer(s)
GNOME Software maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-05-27 14:54 UTC by Branko Grubic (bitlord)
Modified: 2015-05-29 11:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Port to SoupSession (6.55 KB, patch)
2015-05-29 11:10 UTC, Kalev Lember
committed Details | Review
Set soup session timeout and idle-timeout properties to 60 (3.75 KB, patch)
2015-05-29 11:12 UTC, Kalev Lember
committed Details | Review

Description Branko Grubic (bitlord) 2015-05-27 14:54:19 UTC
Gnome-Software after it is close is still running in the background 
<user>    2104  0.3  2.9 1070504 120792 tty2   Sl+  15:18   0:17 /usr/bin/gnome-software --gapplication-service

and doesn't close "connections" properly
tcp        1      0 192.168.1.2:58742       152.19.134.142:443      CLOSE_WAIT  2104/gnome-software 
tcp        1      0 192.168.1.2:36973       209.132.181.27:80       CLOSE_WAIT  2104/gnome-software

This is 10+minutes after application is closed.

gnome-software-3.16.2-2.fc22.x86_64
Comment 1 Matthias Clasen 2015-05-28 22:02:51 UTC
       priv->session = soup_session_sync_new_with_options 
                                        (SOUP_SESSION_USER_AGENT,
                                        "gnome-software",
                                        SOUP_SESSION_TIMEOUT, 5000,
                                        NULL);

        /**
         * SoupSession:timeout:
         *
         * The timeout (in seconds) for socket I/O operations
         * (including connecting to a server, and waiting for a reply
         * to an HTTP request).

Did you really mean to set a timeout of 5000 seconds ?

You may also want to set idle-timeout, to limit the lifetime of persistent connections. 

Finally, maybe we should call soup_session_abort() when the window is closed ?
Comment 2 Matthias Clasen 2015-05-28 22:05:53 UTC
Another note: SoupSessionSync is deprecated, maybe we should port to SoupSession ?

https://developer.gnome.org/libsoup/2.50/libsoup-session-porting.html
Comment 3 Kalev Lember 2015-05-29 11:10:05 UTC
Created attachment 304235 [details] [review]
Port to SoupSession

Since libsoup 2.42, SoupSession is no longer an abstract class and is
preferred over SoupSessionSync that we've been using. Switching over
brings us nicer timeout and idle-timeout defaults and an out-of-box
proxy setup we no longer have to manually set up.
Comment 4 Kalev Lember 2015-05-29 11:11:31 UTC
And another patch for stable branches that makes the timeout defaults sane without switching to SoupSession:
Comment 5 Kalev Lember 2015-05-29 11:12:08 UTC
Created attachment 304236 [details] [review]
Set soup session timeout and idle-timeout properties to 60

This ensures connections get closed in a reasonable time and not left
hanging.
Comment 6 Kalev Lember 2015-05-29 11:42:54 UTC
Comment on attachment 304236 [details] [review]
Set soup session timeout and idle-timeout properties to 60

Attachment 304236 [details] pushed as d7d6e19 - Set soup session timeout and idle-timeout properties to 60
Comment 7 Kalev Lember 2015-05-29 11:43:27 UTC
Attachment 304235 [details] pushed as 34c7b0a - Port to SoupSession