GNOME Bugzilla – Bug 732925
Allow sync and async methods to be called with the same GMainContext
Last modified: 2014-07-19 15:28:13 UTC
Since gvfs was ported to use a single SoupSession for sync and async methods, the webdav backend fails when performing concurrent operations. This is because the operations are run from different threads with the same thread-default GMainContext. It would be nice if this worked OK (I don't see why the GMainContext should matter for the sync methods of SoupSession). Thanks
Created attachment 280196 [details] [review] soup-session: Only process async items from async_run_queue Only process async items from async_run_queue to allow sync and async methods to run concurrently in separate threads with the same async_context.
The attached patch fixes the issue for me. I have attached a test program which demonstrates the problem (this may require the patch from bug 732783 to be applied). Sample output: $ ./concurrent2 GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications. (process:3604): libsoup-WARNING **: (soup-session.c:2009):soup_session_process_queue_item: runtime check failed: (item->async) (process:3604): libsoup-WARNING **: (soup-session.c:1977):soup_session_process_queue_item: runtime check failed: (item->new_api) (process:3604): libsoup-CRITICAL **: soup_connection_get_ever_used: assertion 'SOUP_IS_CONNECTION (conn)' failed (process:3604): libsoup-CRITICAL **: soup_message_queue_remove: assertion '!item->removed' failed Segmentation fault (core dumped) gdb backtrace at the point of the first warning:
+ Trace 233794
Thread 2 (Thread 0x7ffff56a3700 (LWP 3593))
Thread 1 (Thread 0x7ffff7fc7700 (LWP 3589))
Created attachment 280197 [details] program to reproduce the problem
Comment on attachment 280196 [details] [review] soup-session: Only process async items from async_run_queue yes, this looks right
Comment on attachment 280196 [details] [review] soup-session: Only process async items from async_run_queue Pushed to master as d0cbd4a11f1d5968db4856dbc0d97496b3cb0d6b. Thanks for the review!