issue #179: ec0_receive() and connect_bootstrap() should use deadline.

Now there is a single global deadline derived from ansible.cfg timeout=
value.
This commit is contained in:
David Wilson 2018-05-11 18:15:43 +01:00
parent 2c309a378a
commit d65e047b12
2 changed files with 5 additions and 3 deletions

View File

@ -1,4 +1,7 @@
sudo: required sudo: required
addons:
apt:
update: true
notifications: notifications:
email: false email: false

View File

@ -756,11 +756,10 @@ class Stream(mitogen.core.Stream):
def _ec0_received(self): def _ec0_received(self):
LOG.debug('%r._ec0_received()', self) LOG.debug('%r._ec0_received()', self)
write_all(self.transmit_side.fd, self.get_preamble()) write_all(self.transmit_side.fd, self.get_preamble())
discard_until(self.receive_side.fd, 'EC1\n', time.time() + 10.0) discard_until(self.receive_side.fd, 'EC1\n', self.connect_deadline)
def _connect_bootstrap(self, extra_fd): def _connect_bootstrap(self, extra_fd):
deadline = time.time() + self.connect_timeout discard_until(self.receive_side.fd, 'EC0\n', self.connect_deadline)
discard_until(self.receive_side.fd, 'EC0\n', deadline)
self._ec0_received() self._ec0_received()