Bug 85640 - Add nice_agent_remove_stream_async() for PseudoTCP fin-ack completion
Summary: Add nice_agent_remove_stream_async() for PseudoTCP fin-ack completion
Status: RESOLVED MOVED
Alias: None
Product: nice
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: All All
: medium major
Assignee: Olivier Crête
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-30 09:12 UTC by Philip Withnall
Modified: 2015-06-26 14:03 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Philip Withnall 2014-10-30 09:12:10 UTC
Currently, there’s a nice race in component_close(), between pseudo_tcp_socket_close() (which sends the first packet in the TCP FIN handshake), and freeing all the agent’s candidates (and hence closing their underlying sockets).

The only way to reliably fix that is to make pseudo_tcp_socket_close() block on completing the handshake, or timing out. But blocking for that long would be terrible, so the solution also has to involve making component_close() and all of its callers, all the way up to nice_agent_remove_stream(), asynchronous, a la g_io_stream_close_async().

See the mailing list thread: http://lists.freedesktop.org/archives/nice/2014-October/000979.html
And the FIXME commit: http://cgit.freedesktop.org/libnice/libnice/commit/?id=88cd37a4ffbe4bc623eda2c0ac01565d467976f3
Comment 1 Olivier Crête 2014-10-30 14:36:05 UTC
I guess this doesn't happen if one uses g_io_stream_close_async() ?
Comment 2 Philip Withnall 2014-10-30 17:06:06 UTC
(In reply to Olivier Crête from comment #1)
> I guess this doesn't happen if one uses g_io_stream_close_async() ?

Nope, it will also happen then (well, the race is still technically present). I don’t know how easy it is to trigger on that code path.

This is all because pseudo_tcp_socket_[close|shutdown]() are non-blocking and sync.
Comment 3 Philip Withnall 2015-06-26 14:03:12 UTC
Migrated to Phabricator: http://phabricator.freedesktop.org/T110


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.