I agree it's a bug in conch and I believe my repo shows a reproducible example. Run the test, it never completes because the deferred from `makeDirectory` never fires. .
On Fri, Sep 25, 2020 at 3:41 AM Jean-Paul Calderone < exar...@twistedmatrix.com> wrote: > On Thu, Sep 24, 2020 at 8:54 PM Robert DiFalco <robert.difa...@gmail.com> > wrote: > >> Why exactly is makeDirectory not firing any callbacks or errbacks and >> what can I add at the Factory level to make it do so? >> > > class MySSHClientFactory(SSHClientFactory): >> def clientConnectionLost(self, connector, reason): >> self.op.addErrback(reason) >> >> def makeDirectory(self, path, attrs): >> self.op = Deferred() >> def _cbSuccess(result): >> self.op.callback(result) >> >> return self.sftpClient.makeDirectory(path, >> attrs).addCallback(_cbSuccess)d >> >> > This code is wrong. It takes what *may* be a perfectly good Deferred > from makeDirectory and breaks the error chain off of it. The correct way > to do this would be more like `makeDirectory(...).chainDeferred(self.op)`. > However, `self.op` and `_cbSuccess` are doing nothing useful here so you > may as well just delete all that and return the `makeDirectory(...)` > Deferred. > > If *that* Deferred doesn't fire its errback chain when the connection is > closed, that's a bug in Conch. If you can put together a minimal example > and file a ticket, that would be wonderful and perhaps someone can get it > fixed for you. > > Jean-Paul > _______________________________________________ > Twisted-Python mailing list > Twisted-Python@twistedmatrix.com > https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python >
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python