[tahoe-dev] 回复: Re: hello
David-Sarah Hopwood
david-sarah at jacaranda.org
Tue Nov 6 17:32:45 UTC 2012
On 03/11/12 03:29, han zheng wrote:
> Thank you, just as you said, I wrote some python code like this(test.py):
> ----------------------------------------------------------------------------
> ......
> if __name__ == "__main__":
> c = client.Client("/home/nick/.tahoe")
> uploader = c.getServiceNamed("uploader")
> uploadable = FileName("/home/nick/test.tar.gz",None)
> d = uploader.upload(uploadable)
> d.addCallback(printSuccess)
> d.addErrback(printError)
>
> reactor.callLater(10,reactor.stop)
> reactor.run()
> ----------------------------------------------------------------------------
>
> When I ran "python test.py"(the file located in "/home/nick/.tahoe"), there was an Failure
> instance like this: "client gave us zero servers"
The problem I think is that this code isn't waiting for a connection to the servers to
be established. That can sometimes take a minute or more. If requests are performed too
early they can fail as described in <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/719>.
This is part of the reason why we use a gateway. If every command had to establish a
connection to all servers, the per-command overhead would be *much* higher.
--
David-Sarah Hopwood ⚥
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
URL: <http://tahoe-lafs.org/pipermail/tahoe-dev/attachments/20121106/7b13b3df/attachment.pgp>
More information about the tahoe-dev
mailing list