Opened at 2016-09-09T17:37:49Z
Closed at 2016-09-09T23:30:26Z
#2826 closed task (fixed)
CLI: allow dispatch functions to return a Deferred
Reported by: | warner | Owned by: | warner |
---|---|---|---|
Priority: | normal | Milestone: | 1.12.0 |
Component: | code | Version: | 1.11.0 |
Keywords: | Cc: | ||
Launchpad Bug: |
Description
This will enable #2490 to run (async) Tor operations during tahoe create-node --listen=tor. Currently all CLI dispatch functions must finish synchronously.
The file-operation subcommands, which use blocking httplib calls, must be run from unit tests under deferToThread. #2825 is about fixing that, but this ticket will do some cleanup that will help. Specifically it will move the deferToThread down into runner.py, using the thread only on the subcommands which really need it. After this is fixed, there should be no deferToThread calls in the unit tests.
Change History (2)
comment:1 Changed at 2016-09-09T23:30:00Z by warner
comment:2 Changed at 2016-09-09T23:30:26Z by Brian Warner <warner@…>
- Resolution set to fixed
- Status changed from new to closed
In 802cfc8/trunk:
The branch is ready to land. It looks like there's one deferToThread left in the test suite: test_runner.RunBinTahoeMixin.run_bintahoe uses subprocess.Popen underneath deferToThread. I *think* this can be replaced with a reactor.spawnProcess, but I'm not 100% sure, and I don't want to go messing with it right now, so I'm going to leave that cleanup for another day.