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 678615 - _g_vfs_daemon_call_sync() does not cancel for HTTP request
_g_vfs_daemon_call_sync() does not cancel for HTTP request
Status: RESOLVED WONTFIX
Product: gvfs
Classification: Core
Component: http backend
1.13.x
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
evolution[account-mgmt]
Depends on:
Blocks:
 
 
Reported: 2012-06-22 09:12 UTC by Milan Crha
Modified: 2012-12-07 17:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Cancelling account details lookup (4.89 KB, patch)
2012-07-07 19:51 UTC, Matthew Barnes
none Details | Review

Description Milan Crha 2012-06-22 09:12:13 UTC
It would be good to have "Looking up account details" (when crating a new account, when moving on after Name/Email being filled) cancellable, as some servers can just reject response to the request, making it just timeout.
Comment 1 Matthew Barnes 2012-07-07 19:51:58 UTC
Created attachment 218237 [details] [review]
Cancelling account details lookup

I implemented this over the weekend and as far as I can tell I'm doing everything right, but when I actually cancel the lookup the gvfs call just hangs forever.

Here's the backtrace:

Thread 42 (Thread 0xa425ab70 (LWP 19751))

  • #0 __kernel_vsyscall
  • #1 *__GI___poll
    at ../sysdeps/unix/sysv/linux/poll.c line 87
  • #2 g_poll
    at /build/buildd-glib2.0_2.32.3-1-i386-987P8N/glib2.0-2.32.3/./glib/gpoll.c line 132
  • #3 _g_vfs_daemon_call_sync
    at gvfsdaemondbus.c line 764
  • #4 do_sync_path_call
    at gdaemonfile.c line 433
  • #5 g_daemon_file_read
    at gdaemonfile.c line 1090
  • #6 g_file_read
    at /build/buildd-glib2.0_2.32.3-1-i386-987P8N/glib2.0-2.32.3/./gio/gfile.c line 1481
  • #7 g_file_load_contents
    at /build/buildd-glib2.0_2.32.3-1-i386-987P8N/glib2.0-2.32.3/./gio/gfile.c line 6226
  • #8 mail_autoconfig_lookup
    at e-mail-autoconfig.c line 349
  • #9 mail_autoconfig_initable_init
    at e-mail-autoconfig.c line 681
  • #10 g_initable_init
    at /build/buildd-glib2.0_2.32.3-1-i386-987P8N/glib2.0-2.32.3/./gio/ginitable.c line 115
  • #11 async_init_thread
    at /build/buildd-glib2.0_2.32.3-1-i386-987P8N/glib2.0-2.32.3/./gio/gasyncinitable.c line 270
  • #12 run_in_thread
    at /build/buildd-glib2.0_2.32.3-1-i386-987P8N/glib2.0-2.32.3/./gio/gsimpleasyncresult.c line 861
  • #13 io_job_thread
    at /build/buildd-glib2.0_2.32.3-1-i386-987P8N/glib2.0-2.32.3/./gio/gioscheduler.c line 177
  • #14 g_thread_pool_thread_proxy
    at /build/buildd-glib2.0_2.32.3-1-i386-987P8N/glib2.0-2.32.3/./glib/gthreadpool.c line 309
  • #15 g_thread_proxy
    at /build/buildd-glib2.0_2.32.3-1-i386-987P8N/glib2.0-2.32.3/./glib/gthread.c line 801
  • #16 start_thread
    at pthread_create.c line 304
  • #17 clone
    at ../sysdeps/unix/sysv/linux/i386/clone.S line 130
  • #0 __kernel_vsyscall
  • #3 _g_vfs_daemon_call_sync
    at gvfsdaemondbus.c line 764
$1 = 1

So I guess I'll sit on this until I can figure out what's going on.  I've attached the patch anyway.
Comment 2 Matthew Barnes 2012-07-07 19:56:54 UTC
(In reply to comment #1)
> $1 = 1

Bugzilla ate my gdb log.

Anyway I was trying to show that the GCancellable passed to _g_vfs_daemon_call_sync() in frame 3 is indeed cancelled, but this call seemingly never returns so the progress page with the spinner just spins forever.
Comment 3 Matthew Barnes 2012-07-08 06:01:14 UTC
Reassigning to gvfs, not to place blame but to solicit help because I'd like for this to work.  If I'm doing it wrong I'm willing to change it.

The relevant Evolution code is here:
http://git.gnome.org/browse/evolution/tree/mail/e-mail-autoconfig.c#n331

I'm basically just calling g_file_load_contents() on an http URI pointing to "api.gnome.org".
Comment 4 Tomas Bzatek 2012-12-06 13:54:11 UTC
gvfs takes cancellable in account more thoroughly now, after gdbus port. Any chance to retest this with at least 1.14 series of gvfs?

(In reply to comment #3)
> The relevant Evolution code is here:
> http://git.gnome.org/browse/evolution/tree/mail/e-mail-autoconfig.c#n331

I see libsoup used, has the decision changed since the original intention?

FYI, there's ongoing port to SoupRequester going on in bug 687757, that could change things a bit. In fact, cancelling a http transfer (read operation) is working fine on my side.
Comment 5 Matthew Barnes 2012-12-06 14:35:49 UTC
(In reply to comment #4)
> I see libsoup used, has the decision changed since the original intention?

Yes, I rewrote the Evolution code to use libsoup directly in:
http://git.gnome.org/browse/evolution/commit/?id=de8aea580de68963bc61838c2889f040f6d3b563

Mainly to avoid the cancellation hang observed in this bug.
Comment 6 Tomas Bzatek 2012-12-07 17:31:07 UTC
Okay, no problem. Closing for now, the SoupRequester port will change state of things anyway. Feel free to reopen if you spot this issue again.