| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, run
```
git grep -l "^edition =" |
xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;'
```
Second, manually verify that all Cargo.toml files have changed,
and nothing else has changed.
Third, run cargo fmt again.
|
| |
|
|
|
|
|
| |
We want to store this separately from the consensus,
because we want to access it very early in our load-from-cache
process, without checking the consensus that contains it
for timeliness.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
missing/incompatbile.
This fixes a bug in `SqliteStore`'s constructor: previously, it would
unconditionally try to create the missing database, even if it didn't
have write access. As a result, it was impossible to reliably start
multiple concurrent arti processes configured with the same (empty or
nonexistent) cache_dir, because many of them would fail with errors such
as
```
attempt to write a readonly database: Error code 8: Attempt to write a readonly database
```
Returning a `LocalResourceAlreadyInUse` error kind here enables us to
leverage the retry loop from `TorClientBuilder::create_unbootstrapped`
(which retries on local resource errors if `local_resource_timeout` is
set).
Closes #1497
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This code needs fs_mistrust::Error and tor_error::ErrorKind. I think
we probably don't want fs_mistrust to depend on tor_error or vice
versa.
tor_persist is approximately the place where these two threads of
thought come together, and it's currently the lowest place where this
is needed.
Use it in tor-dirmgr too, which is currently the other place that
embodies this knowledge about fs_mistrust::Error.
|
| |
|
|
| |
This allows use with tor_error::Report.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes an busy-loop.
When the last `TaskHandle` on a `TaskSchedule` is dropped, the
schedule is permanently canceled: whatever operation it was
scheduling should no longer be performed. But our code was broken:
the `sleep()` and `sleep_until_wallclock()` functions don't verify
whether the handles are dropped or not.
This breakage caused an CPU-eating busy-loop in
`sleep_until_wallclock`.
With this patch, we now return a `Result<(), SleepError>` from these
functions.
Fixes #572.
|
| |
|
|
| |
Closes #555
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
Now that the relevant functions now report changed/not-changed
status via a boolean out-parameter (see !527), there's no reason to
have a separate NoChanged error case.
Closes #484.
|
| |
|
|
| |
It does nothing that Fatal does not. Suggested by @eta in review.
|
| |
|
|
|
|
| |
This commit adds a couple of new error types that we will soon want
to distinguish, and a new way of classifying errors. These are not
yet all used.
|
| |
|
|
|
| |
Fortunately, the only error type that we need to handle blocking
errors with actually has a DirSource in it already.
|
| |
|
|
|
|
|
|
|
| |
This was anomalous, in that it contains &'static str, rather than a
proper nested error (eg a config::ConfigError, maybe).
But in fact it tursn out it is now not constructed. The last
construction site was removed a long time ago in
Use derive_builder for Authority and FallbackDir.
|
| |
|
|
|
|
|
|
| |
- We don't want to inadvertently replace our netdir with one that's
actually older, so detect and error on this condition.
- Also, print a debug line when we get a new netdir without enough
guards.
- (An unrelated TODO was also added.)
|
| | |
|
| |
|
|
| |
Typos found with codespell.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
So we get a stack trace
|
| |
|
|
|
| |
We're about to reuse this and we'll want it to take the higher-level
type. Also it seems more proper like this.
|
| |
|
|
|
| |
This isn't complete (see TODO), but it's enough to let us report the
right ErrorKind if something fails to parse.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
At first I had thought that all sqlite errors would be internal, but that's
not the case.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit changes how the `TorClient` type works, enabling it to be
constructed synchronously without initiating the bootstrapping process.
Daemon tasks are still started on construction (although some of them
won't do anything if the client isn't bootstrapped).
The old bootstrap() methods are now reimplemented in terms of the new
create_unbootstrapped() and bootstrap_existing() methods.
This required refactoring how the `DirMgr` works to enable the same sort
of thing there.
closes #293
|
| |
|
|
|
| |
(By our convention, these errors should say what we were trying to
spawn when the error occurred.)
|
| |
|
|
|
| |
This patch makes only minimal changes in lower-level error types:
we have more refactoring to do.
|
| | |
|
| |
|
|
| |
Also, tell the "typos" tool to ignore Cargo.lock.
|
| | |
|
|
|
This will cause some pain for now, but now is really the best time
to do this kind of thing.
|