Opened 6 years ago

Last modified 3 years ago

#3371 defect new

twisted.internet.test.test_tls fails for glib2/gtk2 on windows

Reported by: exarkun Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:
Author: Launchpad Bug:

Description

It's not clear why. The tests hang for for the two minutes they're allowed to, then time out.

Attachments (1)

test_tls.patch (917 bytes) - added by exarkun 3 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 6 years ago by exarkun

(In [24473]) Merge ssl-disconnection-3218-4

Author: exarkun
Reviewer: jknight, therve, radix
Fixes: #3218

Work around a bad behavior in the Linux implementation of select(2)
which interacted with OpenSSL to cause SelectReactor to sometimes be
unable to detect that a TCP connection which had switched to TLS had
been disconnected. This change causes SelectReactor to check such
connections for readability (in addition to the existing check for
writeability), since Linux adds these sockets only to the read set.

This also adds the utility method ReactorBuilder.runReactor which
wraps reactor.run() with additional logic to enforce timeouts for
tests.

This re-merge fixes failures on Windows of the new TLS tests under
the glib2 and gtk2 reactors by skipping testing that configuration.
See #3371.

comment:2 Changed 5 years ago by khorn

The comments above seem to indicate that this may have been fixed. Is this the case, or is there more work yet to be done?

comment:3 Changed 5 years ago by exarkun

One supposes the tests will still hang and then fail due to timeout. The only thing the referenced change did was skip the tests where they were doing this, not fix them.

comment:4 Changed 4 years ago by <automation>

  • Owner glyph deleted

Changed 3 years ago by exarkun

comment:5 Changed 3 years ago by exarkun

When #4854 is resolved, SSL will be a lot closer to TCP. The attached patch changes the skipped tests to not skip when the new, nicer SSL implementation is available. Some build slaves will need to have pygtk/pyOpenSSL installed/upgraded in order to really test this code path, though. Hopefully when #4854 is resolved these tests will just pass, but I dunno.

comment:6 Changed 3 years ago by exarkun

(In [31476]) Back out changes which depend on #4854

refs #4987
refs #4854
refs #3371

comment:7 Changed 3 years ago by zseil

This problem might be caused by a bug in glib itself. See:

https://bugzilla.gnome.org/show_bug.cgi?id=331214#c13

and the second problem in:

https://bugzilla.gnome.org/show_bug.cgi?id=357674.

It seems that glib looses the FD_CLOSE event when that event arrives together with the last FD_READ event during graceful shutdown. In that case, the recv finishes without errors and because the FD_CLOSE event is edge triggered, glib never notices that the connection was closed.

comment:8 Changed 3 years ago by exarkun

#5333 was a duplicate of this - see that ticket for a few tiny extra details.

Note: See TracTickets for help on using tickets.