| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Denies 'mod.rs' files for consistency.
https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
|
| |
|
|
|
|
|
|
| |
In 1.83, this warning triggers on many of our crates.
We're thinking of fixing them all, but for now,
we're going to disable the warning.
This is part of #1765.
|
| |
|
|
| |
Fixes: #1691
|
| |
|
|
|
| |
`DirMgrConfig::update_from_config` uses the old value and not the new
value, so it should be reported using `Reconfigure::cannot_change`.
|
| | |
|
| |
|
|
|
|
| |
The `derive_more` crate broke backward compatibility with this version,
so this change involved quite a few manual fixups.
With luck, they'll keep compatibility for some while in the future.
|
| |
|
|
|
|
|
| |
With this extension trait, we no longer need to construct
`CompoundRuntime` directly outside of tor-rtcompat. This in turn
will make it a little less painful when we have to add more generics
to CompoundRuntime.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Having this in the `tor-async-utils` crate prevents us from doing both
of the following without introducing a circular dependency:
* using it in `tor-rtmock` (which we currently do, particularly in
tests).
* using `tor-rtmock` to test things in `tor-async-utils`. We don't do
this yet, but it is generally sensible to do so. In particular we
want to move the `stream_peak` module there, which is currently tested
with `tor-rtmock`.
Moving this into its own crate avoids this circular dependency.
|
| |\
| |
| |
| |
| |
| |
| | |
tor-dirmgr: Return an error if storage is readonly and DB is missing/incompatbile.
Closes #1497
See merge request tpo/core/arti!2283
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |/ |
|
| | |
|
| | |
|
| |
|
|
| |
Sadly, rustc seems to want us to mark this allow in several places.
|
| |\
| |
| |
| |
| |
| |
| | |
dirmgr::storage: Treat a missing blob file as an absent object.
Closes #1466
See merge request tpo/core/arti!2200
|
| | |
| |
| |
| | |
SQL is case-insensitive, but it is still nice to be consistent.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch removes files from dir_blobs if they are not referenced
from the database, or if their filenames are not valid UTF-8.
(If they were not valid UTF-8, we wouldn't have put them in our
database.)
To ensure that there can't be any race conditions, we only do this
when the file is a bit old.
|
| | |
| |
| |
| |
| | |
Previously, we were putting an (optional) db.sql file and our blobs
into the same path, which is not what we do outside of our tests.
|
| | |
| |
| |
| |
| |
| | |
Without this, "ON DELETE CASCADE" will do nothing.
Part of fixing #1466.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously it was counted as a hard error, which would cause an
absolute failure to start if a blob file had been deleted improperly
-- for example, by a renegade cache-cleaner that had decided to
remove the largest files it could find.
Upon encountering a missing blob, we remove it from the database as
well: if we did not, then unavailable consensuses could still cause
us to try to fetch consensus diffs, because their rows would still
be present.
Fixes #1466.
|
| | |
| |
| |
| |
| |
| | |
This should help limit our memory usage when restarting from cache.
Possible (imperfect) solution for #1027.
|
| |/ |
|
| |
|
|
|
|
|
| |
Related to C-tor MR:
https://gitlab.torproject.org/tpo/core/tor/-/merge_requests/819
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
Per comments on #1383, we're keeping these methods.
This commit replaces the "TODO" comments with comments explaining
why it's okay that this methods are unused.
Part of #1383.
|
| | |
|
| |
|
|
| |
This commit is automatically generated.
|
| | |
|
| |
|
|
| |
This seems to be used only in tests, since at least 2022.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
C-tor commit for this change:
e3e4fa35e8b9368ac549db4da3240aba1ee3054e
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
| |
In all the uses in-crate, this is just a RealCoarseTimeProvider.
Now all the compound runtimes impl CoarseTimeProvider.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Since Rust 1.66, std's default works properly for enums, provided that
the default variant is a unit.
Review all uses of `#[educe(default)]` on enums and replace them with
std where possible, which is most of them.
In 1.66 and later, std's `#[derive(Default)]` doesn't infer any
generic bounds on the derived impl, where it's an enum - since the
unit variant can always be constructed. So this change doesn't add
any generic bounds and is not API-visible.
|
| | |
|
| | |
|
| |
|
|
| |
Prompted by clippy.
|
| |
|
|
|
|
|
|
|
|
|
| |
This commit makes the `dir_mgr_config` method of the `TorClientConfig`
struct public.
It might be questionable whether we should make this function public or
switch to a `TryInto` trait in general, which also seems like an even
Rustier solution Rustier solution.
Fixes #1175
|
| |
|
|
|
|
| |
Filed
https://gitlab.torproject.org/tpo/core/arti/-/issues/1177
proposing a final fix.
|
| |
|
|
|
|
| |
Filed
https://gitlab.torproject.org/tpo/core/arti/-/issues/1176
proposing a final fix.
|
| |
|
|
|
| |
FTR I don't think agree with clippy on this question, but then I often
don't.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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 variable contains precisely the value of cache_dir from
arti_client::config::StorageConfig and it should therefore have the
same name.
|
| |
|
|
| |
cargo fmt, precisely.
|
| | |
|