Merge remote-tracking branch 'origin/dmw'

- issue #323, #333 WSL workaround.
issue260
David Wilson 6 years ago
commit 8ef8f7b123

@ -1,4 +1,7 @@
# Mitogen
<!-- [![Build Status](https://travis-ci.org/dw/mitogen.png?branch=master)](https://travis-ci.org/dw/mitogen}) -->
<a href="https://mitogen.readthedocs.io/">Please see the documentation</a>.
![](https://i.imgur.com/eBM6LhJ.gif)

@ -135,7 +135,8 @@ Enhancements
^^^^^^^^^^^^
* `#76 <https://github.com/dw/mitogen/issues/76>`_,
`#351 <https://github.com/dw/mitogen/issues/351>`_: disconnect propagation
`#351 <https://github.com/dw/mitogen/issues/351>`_,
`#352 <https://github.com/dw/mitogen/issues/352>`_: disconnect propagation
has improved, allowing Ansible to cancel waits for responses from targets
that where abruptly disconnected. This increases the chance a task will fail
gracefully, rather than hanging due to the connection being severed, for
@ -153,6 +154,11 @@ Enhancements
Fixes
^^^^^
* `#323 <https://github.com/dw/mitogen/issues/323>`_,
`#333 <https://github.com/dw/mitogen/issues/333>`_: work around a Windows
Subsystem for Linux bug that would cause tracebacks to be rendered during
shutdown.
* `#334 <https://github.com/dw/mitogen/issues/334>`_: the SSH method
tilde-expands private key paths using Ansible's logic. Previously Mitogen
passed the path unmodified to SSH, which would expand it using
@ -224,9 +230,11 @@ Mitogen would not be possible without the support of users. A huge thanks for
bug reports, features and fixes in this release contributed by
`Berend De Schouwer <https://github.com/berenddeschouwer>`_,
`Brian Candler <https://github.com/candlerb>`_,
`Duane Zamrok <https://github.com/dewthefifth>`_,
`Guy Knights <https://github.com/knightsg>`_,
`Jiří Vávra <https://github.com/Houbovo>`_,
`Jonathan Rosser <https://github.com/jrosser>`_,
`Josh Smift <https://github.com/jbscare>`_,
`Mehdi <https://github.com/mehdisat7>`_, and
`Mohammed Naser <https://github.com/mnaser/>`_.

@ -108,6 +108,7 @@ try:
except NameError:
BaseException = Exception
IS_WSL = 'Microsoft' in os.uname()[2]
PY3 = sys.version_info > (3,)
if PY3:
b = str.encode
@ -1920,7 +1921,9 @@ class IoLogger(BasicStream):
def on_shutdown(self, broker):
"""Shut down the write end of the logging socket."""
_v and LOG.debug('%r.on_shutdown()', self)
self._wsock.shutdown(socket.SHUT_WR)
if not IS_WSL:
# #333: WSL generates invalid readiness indication on shutdown()
self._wsock.shutdown(socket.SHUT_WR)
self._wsock.close()
self.transmit_side.close()

@ -1,4 +1,4 @@
# Copyright 2018, Yannig Perré
# Copyright 2018, Yannig Perre
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:

@ -68,7 +68,6 @@ from mitogen.core import LOG
from mitogen.core import IOLOG
IS_WSL = 'Microsoft' in os.uname()[2]
itervalues = getattr(dict, 'itervalues', dict.values)
if mitogen.core.PY3:
@ -178,7 +177,7 @@ def disable_echo(fd):
old = termios.tcgetattr(fd)
new = cfmakeraw(old)
flags = getattr(termios, 'TCSASOFT', 0)
if not IS_WSL:
if not mitogen.core.IS_WSL:
# issue #319: Windows Subsystem for Linux as of July 2018 throws EINVAL
# if TCSAFLUSH is specified.
flags |= termios.TCSAFLUSH

Loading…
Cancel
Save