| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
Remove all `use` statements for `TryFrom` and `TryInto`. These are
now redundant in Rust 2021.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Doing this will make us treat caches that send us these objects as
not-working, and close circuits to them instead of trying over and
over.
The case where we add a document from the cache requires special
handling: it isn't actually a error to find an expired document in
our cache (unless the passage of time itself is erroneous, which is
a debatable proposition at best).
Fixes #431.
|
| |
|
|
|
| |
Replace the next delay field immediately rather than taking it and
_then_ setting it. This way, it's never in an incorrect state.
|
| |
|
|
|
|
|
|
|
|
| |
The previous algorithm had two flaws:
* It would wait even after the final attempt, when there were no
more retries to do.
* It would fail to wait between attempts if an error occurred.
This refactoring fixes both of these issues, and adds some comments.
|
| |
|
|
|
|
|
|
|
|
|
| |
We do this by creating a new FallbackSet type that includes status
information, and updating the GuardMgr APIs to record success and
failure about it when appropriate. We can use this to mark
FallbackDirs retriable (or not).
With this change, FallbackDir is now stored internally as a Guard in
the GuardMgr crate. That's fine: the FallbackDir type really only
matters for configuration.
|
| |
|
|
|
|
|
| |
This is the final step in allowing the CircMgr to use the GuardMgr's
view of the fallbacks.
Compilation is restored and tests pass.
|
| | |
|
| |\
| |
| |
| |
| |
| |
| | |
Don't use SystemTime::now()
Closes #306
See merge request tpo/core/arti!365
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
Some error types indicate that the guard has failed as a dircache.
We should treat these errors as signs to close the circuit, and to
mark the guard as having failed.
|
| |/
|
|
|
|
| |
It'll soon more convenient to pass in FallbackDirs as a slice of
references, rather than just a slice of FallbackDirs: I'm going to
be changing how we handle these in tor-dirmgr.
|
| | |
|
| |
|
|
|
|
|
| |
Getting a non-200 status is no longer a failure condition; it's just
a different kind of answer.
Closes #349.
|
| |
|
|
|
|
|
|
| |
It had too many possible Kinds depending on what kind of string had
failed to parse.
I decided to use #[source] here instead of #[from], so that we
would have to explicitly convert these errors where they show up.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The interface is similar to the one exposed by `arti-client`: it
internally uses postage::watch to give a series of events showing
when a bootstrap status is changing.
Thanks to the existing state/driver separation in the DirMgr design
we don't need much new logic: each download state needs to expose
(internally) how far along it is in its download, which the
bootstrap code passes to the DirMgr if it has changed.
I believe that in the long run, we'll probably want to expose more
(or different) information here, and we'll want to process it
differently. With that in mind, I've made the API for
`DirBootstrapStatus` deliberately narrow, so that we can change its
of its internal later on without breaking code that depends on it.
(The information exposed by this commit is not yet summarized in
`arti-client`.)
Part of #96.
|
| |
|
|
|
|
|
|
| |
This approach tries to preserve the current interface, but uses a
counter-based event backend to implement a coalescing stream of
events that can be represented as small integers. The advantage
here is that publishing events no longer needs to be a blocking
operation, since there is no queue to fill up.
|
| |
|
|
|
|
|
|
|
|
| |
We can't change the authorities while in-flight: that would be pretty
miserable to implement.
Similarly we can't change the cache while in-flight.
Everything else should be fair game, though there are a couple of tricky
bits. I've tried to document those.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
It requires tracing-subscriber 0.2, which is a lower version than we
want, and which causes trouble with our minimal-versions CI test.
There is a pending issue to fix this; we can reinstate tracing-test
once it is merged: https://github.com/dbrgn/tracing-test/pull/11
|
| | |
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| | |
Previously our code would clear the 'pending' flag on a consensus
only when a _downloaded_ md made it become usable.
Closes #199.
|
| | |
| |
| |
| |
| | |
The futures::lock::Mutex was unnecessary, since we never held it
when we were suspending.
|
| |/
|
|
| |
(One represents code that I forgot to write.)
|
| | |
|
| |
|
|
|
| |
(Previously we'd report it as successful even if the inner download
task was a failure.)
|
|
|
This will cause some pain for now, but now is really the best time
to do this kind of thing.
|