Telepathy idle ends up with "Connection time out" all the time. It turns out that with glib/gio git master priv->msg_sending flag in idle-connection.c msg_queue_timeout_cb is set to FALSE in the _msg_queue_timeout_ready before behing set to TRUE. This leads to infinite msg_timed_out_cb calls (ie until the server send the connection timed out). The backtrace of the tp idle shows that : g_output_stream_write_real_async triggers _write_async_pollable and in this use case it ends up calling the non idle version g_simple_async_result_complete. All this happens before idle_server_connection_send_async with callback _msg_queue_timeout_ready completes. As this callback set back priv->msg_sending to FALSE, and the initialization of this variable to TRUE happens after the idle_server_connection_send_async call, priv->msg_sending stays at TRUE until connection is aborted by the server. To avoid this the patch calls g_simple_async_result_complete_in_idle instead ofg_simple_async_result_complete_in_idle in idle-server-connection.c function _write_ready.
Created attachment 60614 [details] [review] use idle version of complete
Hi, sorry for the slow response to your bug report. (In reply to comment #0) > The backtrace of the tp idle shows that : > g_output_stream_write_real_async triggers _write_async_pollable and in this > use case it ends up calling the non idle version > g_simple_async_result_complete. Which GLib version are/were you using? I think this was a GLib bug, introduced by this commit <http://git.gnome.org/browse/glib/commit/?id=00ee06e> and fixed by this commit <http://git.gnome.org/browse/glib/commit/?id=fd3ec4d>. Notice that, with the latter patch, g_output_stream_real_write_async() correctly initializes op->need_idle to TRUE.
(In reply to comment #2) > Hi, sorry for the slow response to your bug report. > > (In reply to comment #0) > > The backtrace of the tp idle shows that : > > g_output_stream_write_real_async triggers _write_async_pollable and in this > > use case it ends up calling the non idle version > > g_simple_async_result_complete. > > Which GLib version are/were you using? I think this was a GLib bug, > introduced by this commit > <http://git.gnome.org/browse/glib/commit/?id=00ee06e> and fixed by this > commit <http://git.gnome.org/browse/glib/commit/?id=fd3ec4d>. I notice that you filed your bug in the 10-day gap between these commits. :) I've committed a different patch to make Idle more robust against this kind of bug: <http://cgit.freedesktop.org/telepathy/telepathy-idle/commit/?id=ba22cc0>. Thank you for the report!
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.