summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/err.rs
Commit message (Collapse)AuthorAgeFilesLines
* CircMgr: Remove directory liveness testing.Nick Mathewson2022-07-261-9/+0
|
* Apply 1 suggestion(s) to 1 file(s)Ian Jackson2022-07-131-1/+1
|
* circmgr: Use FilterCounts to explain why we couldn't build pathsNick Mathewson2022-07-121-5/+17
|
* circmgr: Use FilterCounts to explain why we couldn't find an exit.Nick Mathewson2022-07-121-5/+16
|
* tor-circmgr: Clarify and improve Protocol error.Nick Mathewson2022-07-121-1/+19
|
* tor-circmgr: minor error message edits.Nick Mathewson2022-07-121-5/+5
|
* Do not include error source() in display() format.Nick Mathewson2022-06-211-5/+5
| | | | | | | | | According to doc/Errors.md, and in keeping with current best practices, we should not include display an error's `source()` as part of that error's display method. Instead, we should let the caller decide to call source() and display that error in turn. Part of #323.
* circmgr: back off on preemptive circuits if they fail consistentlyNick Mathewson2022-04-121-0/+7
| | | | | | | | | | | | | Rather than running preemptive circuit construction every 10 seconds, we change it to back off when it is "failing". (We define "failing" as creating no new circuits, and as giving at least one error.) This change means that we'll have one less reason to hammer the network when our connectivity is failed for some reason. Closes #437. Part of #329.
* Distinguish UsageMismatch cases by whether a race is possibleNick Mathewson2022-04-041-7/+27
| | | | | | | This lets us say that the UsageMismatch cases in some parts of the code reflect a programming error (RetryTime::Never), whereas in other case it reflects another circuit request getting to the circuit first (RetryTime::Immediate).
* circmgr: implement HasRetryTime.Nick Mathewson2022-04-041-2/+80
|
* circmgr: Improve reporting of error origins.Nick Mathewson2022-04-041-0/+6
| | | | | | | Previously we did not distinguish errors that came from pending circuits from errors that came from the circuits we were building. We also reported errors as coming from "Left" or "Right", instead of a more reasonable description.
* circmgr: Avoid a race condition in circuit usage restrictionNick Mathewson2022-04-041-1/+13
| | | | | | | | | | | | | | | | | | | | | | We were treating restrict_mut() failures as internal errors, and using internal errors to represent them. But in fact, these failures are entirely possible based on timing. Here's how it happens: * Two different circuit requests arrive at the same time, and both notice a pending circuit that they could use. * The pending circuit completes; both pending requests are notified. * The first request calls restrict_mut(), and restricts the request in such a way that the second couldn't use it. * The second request calls restrict_mut(), and gets a failure. Because of this issue, we treat these errors as transient failures and just wait for another circuit. Closes #427. (This is not a breaking API change, since `AbstractSpec` is a crate-private trait.)
* Expose more peer information from circuit build failuresNick Mathewson2022-03-211-4/+24
| | | | | | | | | We already have the ability to get peer information from ChanMgr errors, and therefore from any RetryErrors that contain ChanMgr errors. This commit adds optional peer information to tor-proto errors, and a function to expose whatever peer information is available.
* circmgr: use AllGuardsDown to retry betterNick Mathewson2022-03-211-1/+1
| | | | | | | | | | | | | If all guards are down and they won't be retriable for a while, try waiting that long to get whichever guard _is_ retriable. Additionally, if we are making multiple circuit plans in parallel, only report our planning as having failed if we failed at making _all_ the plans. Previously we treated any failure as fatal for the other plans, which could lead to trouble in the case when guards were all down or pending. Part of #407.
* Fold EK::Canceled into TransientFailureNick Mathewson2022-02-221-1/+7
| | | | Also add some TODO comments in circmgr for future work.
* Handle panics from circuit construction.Nick Mathewson2022-02-181-2/+1
| | | | | | | | | | | | We handle them by reporting them to task that's waiting for the circuit, then relaying the panic. Doing so allows the waiting task to distinguish panics (EK::Internal) from cases where the reactor dropped the task entirely (EK::ReactorShuttingDown). And doing _that_ removes one case of EK::Canceled, which helps us on our goals towards #348. Closes #347.
* Rename CircuitTimeout to TorNetworkTimeout.Nick Mathewson2022-02-171-2/+2
|
* tor_circmgr::Error: Sort variants by interesting-ness.Nick Mathewson2022-02-171-37/+37
| | | | We can't use discriminants here now, but maybe we can in the future.
* Clarify and rename PendingCanceledNick Mathewson2022-02-161-6/+7
| | | | | | | | From its old name, this error had implied that we were giving no useful information when we were waiting on a pending cirucit request that failed. In fact, this error would only happen if we dropped the `mpsc::Sender` for a circuit attempt without reporting success or failure.
* Provide a better ErrorKind from RetryError.Nick Mathewson2022-02-161-3/+26
| | | | (Instead of reporting the _last_ error, report the _worst_ error.)
* circmgr: Add a Kind for speculative guard failure.Nick Mathewson2022-02-161-1/+1
| | | | | | | | | | These errors should almost never be seen by the user; we should instead retry the circuit. But they _can_ be seen by the use if selecting a guard takes too long, or too many attempts. (Therefore, they aren't true "internal" errors.) I suspect that we might not want to keep this TransientFailure kind, but I'm not sure what else to do here for now.
* Add kinds for *most* circmgr errors.Nick Mathewson2022-02-161-15/+29
| | | | There are a couple of tricky ones I'll do separately.
* circmgr: Port InternalError to use Bug.Nick Mathewson2022-02-161-4/+5
|
* Make SpawnError wrappers contain a 'spawning' stringNick Mathewson2022-02-041-8/+18
| | | | | (By our convention, these errors should say what we were trying to spawn when the error occurred.)
* errors: Drop "Error" and "Failed" from various enum variantsIan Jackson2022-02-041-2/+2
|
* tor-circmgr::Error: impl HasKindIan Jackson2022-02-041-0/+12
|
* tor-circmgr: Handle channel creation errors in the new styleIan Jackson2022-02-041-3/+12
|
* spawn errors: Fix arti-client, tor-chanmgr, tor-circmgrIan Jackson2022-02-041-3/+10
| | | | | | | Provide an enum variant to contain the SpawnError and a From impl. We use `#[from]` here because it doesn't really make sense to attach any context, as it's not likely to be very relevant.
* Merge branch 'reconfigure' into 'main'eta2021-12-131-0/+8
|\ | | | | | | | | Make most arti-client fields reconfigurable. See merge request tpo/core/arti!181
| * Fix Rustdoc errors.Nick Mathewson2021-12-081-3/+3
| |
| * Allow on-the-fly changing of path_rulesNick Mathewson2021-12-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | And now the complexity begins: when the user changes the path_rules, they not only want new circuits to obey those rules: they want _all new requests_ to be put onto circuits that obey those rules. That means that when the path rules become more restrictive, we need to retire all the circuits, and make sure that currently pending circuits aren't used for any requests. If it's any comfort, doing this was even more complicated in C tor. ;)
* | Don't create circuits if the consensus is stale by over 72 hoursNeel Chauhan2021-12-121-0/+4
|/
* Implement the guard side of shared state directories.Nick Mathewson2021-10-211-1/+10
|
* Actually select guards for directory circuits.Nick Mathewson2021-10-131-0/+4
|
* Integrate GuardUsability and GuardMonitor into CircuitBuilder.Nick Mathewson2021-10-101-0/+5
| | | | | | (When we're building a path with a guard, we need to tell the guard manager whether the path succeeded, and we need to wait to hear whether the guard is usable.)
* Add a GuardMgr member to CircuitBuilderNick Mathewson2021-10-101-0/+4
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+73
This will cause some pain for now, but now is really the best time to do this kind of thing.