Opened 9 years ago

Last modified 6 years ago

#4744 defect new

Glib2 and Gtk2 reactor don't always report writeable events on Windows

Reported by: Jean-Paul Calderone Owned by:
Priority: normal Milestone:
Component: core Keywords: windows, gtk
Cc: Branch:
Author:

Description

twisted.internet.test.test_tcp.TCPClientTestsBuilder.test_disconnectWhileProducing fails on Windows for these two reactors, apparently because while we are asking the g* io system to tell us about writeability, it never does.

This seems like it's probably a bug in glib or gobject or gtk or pygobject or pygtk.

Change History (2)

comment:1 Changed 8 years ago by <automation>

Owner: Glyph deleted

comment:2 Changed 6 years ago by schlamar

This is probably because you can only register a fd once with gobject.io_add_watch on Windows: https://bugzilla.gnome.org/show_bug.cgi?id=338943.

As a workaround you can de- and re-register the fd for any add_reader and add_writer and do the READ/WRITE multiplexing on your own. As reference you can have a look at my Tornado IOLoop implementation: https://gist.github.com/schlamar/8420193. Note that Tornado already does the multiplexing on its own (there is always just one _handle_events callback per fd), so a Twisted implementation should be more complex.

Note: See TracTickets for help on using tickets.