summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Make the Error detail type non-exported from arti-clientNick Mathewson2022-02-045-44/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At least by default, we should have Error be private, and not expose it as part of our APIs. To keep functionality in `arti`, I had to add an `ExitTimeout` error kind. For interface consistency, I also re-exported ErrorKind and HasError from `arti_client`.
| * | Test that TorError implements the right traits.Nick Mathewson2022-02-041-3/+21
| | | | | | | | | | | | | | | I had planned to use assert_impl, but that can't check for the 'static lifetime.
| * | Make TorError implement Clone.Nick Mathewson2022-02-043-10/+41
| | | | | | | | | | | | | | | This patch makes only minimal changes in lower-level error types: we have more refactoring to do.
* | | Clean up ChannelState ready_to_expireYuan Lyu2022-02-061-10/+9
| | |
* | | Expire channels that have been unused for too longYuan Lyu2022-02-049-30/+304
|/ /
* | Fix a doc link.Nick Mathewson2022-02-041-1/+2
| |
* | Merge branch 'error-poc' into 'main'Nick Mathewson2022-02-0428-61/+743
|\ \ | | | | | | | | | | | | New error handling proof of concept See merge request tpo/core/arti!262
| * | Require backtrace 0.3.8.Nick Mathewson2022-02-041-1/+1
| | | | | | | | | | | | | | | | | | This is the first version that builds correctly on our CI. It's from back in 2018, so requiring it shouldn't cause any major problems.
| * | channel errors: Include what we were doingIan Jackson2022-02-042-11/+16
| | |
| * | errors: Add some TODOs as per discussion commentsIan Jackson2022-02-042-0/+8
| | |
| * | errors: ErrorKind::TODO: Fix typo in messageIan Jackson2022-02-041-1/+1
| | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/262#note_2772816
| * | errors: Change docs for ErrorKind to refer to ArtiIan Jackson2022-02-041-2/+2
| | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/262#note_2772810
| * | errors: Drop "Error" and "Failed" from various enum variantsIan Jackson2022-02-047-9/+9
| | |
| * | Box the Error in a TorErrorIan Jackson2022-02-041-2/+10
| | | | | | | | | | | | | | | | | | This will get quite large and boxing it here is very convenient. This also avoids us exposing a large error type to our callers.
| * | errors: Handle exit circuit creation failure the new wayIan Jackson2022-02-042-2/+22
| | |
| * | errors: Handle circmgr setup errors differentlyIan Jackson2022-02-042-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The motivation for doing this now is to remove the `#[from]` so we would spot where operationsl circuit setup failures were handled. (But it turns out that they are turned into internal errors!) Perhaps this will want to become a different error type from circmgr in due course, but for now we simply use a bespoke variant of TorError. It will want its own Kind. The TODO in the HasKind impl marks this (amongst much else here).
| * | tor-circmgr: Introduce TargetPorts with a pretty Display implIan Jackson2022-02-042-2/+35
| | |
| * | tor-circmgr::Error: impl HasKindIan Jackson2022-02-041-0/+12
| | |
| * | tor-circmgr: Handle channel creation errors in the new styleIan Jackson2022-02-042-4/+19
| | |
| * | tor-chanmgr::Error: impl HasKindIan Jackson2022-02-042-0/+21
| | |
| * | tor-chanmgr: Handle IO errora in the new styleIan Jackson2022-02-042-14/+26
| | | | | | | | | | | | | | | Two ? in the tests become expects, which will do. That avoids having to construct a proper error with context here.
| * | errors: Introduce error_detail featureIan Jackson2022-02-044-3/+39
| | | | | | | | | | | | | | | Right now we must always expose the `Error` type since we haven't converted everything.
| * | errors: Refer to err::Error in some bits of arti_clientIan Jackson2022-02-044-9/+11
| | | | | | | | | | | | We are going to make the top-level Error type conditionally hidden.
| * | errors: Introduce TorErrorIan Jackson2022-02-043-7/+50
| | | | | | | | | | | | Still much to do here.
| * | errors: Initial impl HasKind in arti-client, ErrorKind::TODOIan Jackson2022-02-042-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | This involves making a temporary ErrorKind::TODO. That will continue to exist until all errors (at least, the ones that make it out to here) can be properly categorised. Introducing this will let us work from the top and bottom towards the middle.
| * | errors: impl HasKind for GuardMgrErrorIan Jackson2022-02-041-0/+12
| | |
| * | spawn errors: tor-guardmgr: Use formulaic patternIan Jackson2022-02-041-2/+2
| | | | | | | | | | | | This makes this like all the others, and is marginally shorter
| * | spawn errors: Fix tor-dirmgrIan Jackson2022-02-041-3/+10
| | |
| * | spawn errors: Fix arti-client, tor-chanmgr, tor-circmgrIan Jackson2022-02-043-9/+29
| | | | | | | | | | | | | | | | | | | | | 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.
| * | spawn errors: impl HasKind for futures::SpawnErrorIan Jackson2022-02-043-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | This needs two kinds. We have decided to treat a non-shutdown SpawnError as "unexplained" rather than as an InternalError. There are many crates whose From<futures::task::SpawnError> for Error erroneously treat it as an internal error. We will fix them in a moment.
| * | tor_persist::Error: impl HasKind and adjust commentsIan Jackson2022-02-043-2/+51
| | | | | | | | | | | | | | | And change the comments to slightly reinterpret these errors, to relate to the circumstances rather than error generation site.
| * | tor-error: Add as a ddpendency to many cratesIan Jackson2022-02-045-0/+5
| | | | | | | | | | | | Doing this here makes it easier when I rebase/reorder things
| * | tor-error: provide into_internal!Ian Jackson2022-02-041-0/+33
| | |
| * | tor-error: Allow making an `InternalError` from some other errorIan Jackson2022-02-041-3/+27
| | | | | | | | | | | | | | | | | | | | | This can be used in call sites where an error is thought not to be possible. The `source` will be used only for formatting messages.
| * | tor-error: Introduce InternalError as a type and a kindIan Jackson2022-02-044-1/+148
| | | | | | | | | | | | This can contain a backtrace, which will be printed.
| * | tor-error: Skeleton for new crateIan Jackson2022-02-043-0/+95
| | | | | | | | | | | | | | | | | | As per doc/Errors.md. Currently there are no error kinds. Some will be added as we go along.
| * | tor-persist: Distinguish load vs. store json errorsIan Jackson2022-02-043-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | Serialisation errors ought not to occur, since they would represent an attempt to store malformed data, or something. (We always convert to a string, so the JSON error never contains IO errors or the like.) Deserialisation errors mean the persistent state is corrupt.
| * | tor-circmgr: impl Display for TargetPortIan Jackson2022-02-041-0/+7
| | | | | | | | | | | | This will be used for error handling, and perhaps other things.
| * | tor-linkspec: impl Display for OwnedChanTarget and OwnedCircTargetIan Jackson2022-02-041-0/+23
| | |
| * | tor-circmgr: Turn a type annotation comment into codeIan Jackson2022-02-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | The type annotation may not be necessary for inference, but as a comment it risks becoming false. So it should be uncommented, or deleted. Error types round here are not entirely trivial so uncomment it.
* | | Properly linkify two doc comment xrefs to issuesIan Jackson2022-02-041-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes these messages: warning: this URL is not a hyperlink --> crates/arti/src/watch_cfg.rs:115:5 | 115 | /// https://github.com/notify-rs/notify/issues/165 and | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://github.com/notify-rs/notify/issues/165>` | = note: `#[warn(rustdoc::bare_urls)]` on by default = note: bare URLs are not automatically turned into clickable links warning: this URL is not a hyperlink --> crates/arti/src/watch_cfg.rs:116:5 | 116 | /// https://github.com/notify-rs/notify/pull/166 . | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://github.com/notify-rs/notify/pull/166>` | = note: bare URLs are not automatically turned into clickable links
* | Merge branch 'ticket270' into 'main'Nick Mathewson2022-02-036-17/+303
|\ \ | | | | | | | | | | | | | | | | | | Watch configuration files and reload them when they change Closes #270 See merge request tpo/core/arti!280
| * | Document that `notify` behavior is strange with symlinksNick Mathewson2022-02-033-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (More specifically, `notify` behaves differently on different platforms. On some, it can watch specific directory objects on the filesystem, and so it only notices when _those_ directories change. If you change a symlink so that the canonical configuration file location is now in some other directory, `notify` won't notice. But on other platforms, notify just does "stat()" in a loop. On those, it _will_ notice if the configuration file changes.)
| * | Avoid a potential infinite loop in configuration-watchingNick Mathewson2022-02-031-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the user can put their logfiles and configuration files in the same directory, writing to the log can trigger an event from `notify`. If we log every non-interesting event from `notify`, then we'll trigger the logs every time we log, and fill up the disk. This commit removes the offending log and adds a comment about why. If we someday decide we do need to log here, maybe we can rate-limit the messages or something.
| * | Treat rescan events as meaning "reload configuration".Nick Mathewson2022-02-031-2/+2
| | |
| * | Add a couple of TODOs about configuration-watching.Nick Mathewson2022-02-021-0/+7
| | |
| * | Before reloading configuration, drain all pending file changesNick Mathewson2022-02-021-0/+8
| | | | | | | | | | | | | | | This way, if there are a bunch of changes at once, we only reload one time.
| * | Refactor file-watching code to watch parent directories.Nick Mathewson2022-02-021-8/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to limitations in notify and the OS APIs it uses, it isn't actually so useful to watch a single file. Instead, we have to watch the directories that contain the files, and filter out any events that aren't about the specific files we care about. I've put the logic here into a new type, but I've left the type un-exported: its API is pretty ugly, inasmuch as the caller needs to jump through hoops to only get the events that they want. That's not too bad so long as the API is private, but we'd want better if we were exposing this.
| * | arti: Limit mut-ness of cfg_sources to one block.Nick Mathewson2022-02-021-12/+16
| | |
| * | arti-config: add blank lines between functions.Nick Mathewson2022-02-021-0/+6
| | |