| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
There were two that relied on the the ability to have a lock
in an unlocked state. Instead, we replace those with
Option<LockFileGuard> or its equivalent.
|
| | |
|
| |
|
|
|
|
|
| |
This is temporary while we wait on arti#2106.
(This made cargo-sort have me move a section around. Not sure why it
cares.)
|
| | |
|
| |
|
|
|
|
|
| |
On nightly, clippy now warns against this and recommends using a `match`
instead.
See https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
Here we move the responsibility for removing ExtDoc entries for
vanished blobs into the _caller_ of read_blob(): we want to tidy all
such entries in one go.
Unlike a (reverted) previous approach, this time we don't need a
retry loop.
|
| | |
|
| |
|
|
| |
We'll want to use this information to tell us whether to retry.
|
| |
|
|
| |
I'm about to add a retry mechanism.
|
| |
|
|
|
| |
We've already stopped ignoring any DB errors, so we may as well make
sure that any FS errors we encounter are also reported.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
This will help us keep its members private from the rest
of sqlite.rs, and ensure that things are kept consistent.
(This violates rust formatting for clarity. I'll reindent after.)
|
| | |
|
| |
|
|
|
| |
This is in preparation for making it opaque from the rest
of the code, so that we can more easily reason about it.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This can only happen because of a bug or because of db corruption,
and we probably shouldn't ignore it.
|
| |
|
|
|
|
|
| |
Previously, we would leave the ExtDocs blob to expire on its own,
and it would hang out for up to a week.
Closes #1655.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Also, document that old values will be kicking around
for a little while.
Fortunately:
- Nothing actually looked at these values before.
- All elements in this table have an expiration date, so once a new
version of Arti has been running for a week or two, the old
erroneous values will go away.
|
| |\
| |
| |
| |
| |
| |
| | |
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.
|
| |
|
|
| |
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 seems to be used only in tests, since at least 2022.
|
| |
|
|
|
|
|
| |
Some code in our tests that worked fine with time 0.3.17 no
longer works with 0.3.19, despite the semver.
See https://github.com/time-rs/time/issues/552 for the upstream bug.
|
| |
|
|
|
| |
It looks like, despite a few false starts, they've got this warning
right; there weren't any false positives.
|
| |
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/831#note_2851764
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This introduces the new API functions to Store.
But currently they are all no-ops.
So all this machinery doesn't actually do anything.
Also, it changes the API to the mockable downloader, to allow it to
support if-modified-since. So this isn't used either. But it is more
convenient to do this all at once in BridgeDescManager, since care
needs to be taken about the intraction between if-modified-since and
the persistent cache.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We use the one in the dirmgr. That means that our constructor now has
to take a dirmgr. And, the dirmgr must have a circmgr.
This is all rather odd, TBH.
Add .. to the binding of the return values from setup, as
future-proofing.
The tests now need to provide a Store too. Make the sqlite::new_empty
function pub(crate) so we can use it.
We must retain the _db_tmp_dir, since when it goes away the tmp
directory is deleted and the db goes readonly.
|
| |
|
|
|
|
|
|
|
| |
* Centralise applying the schema updates, in a closure
* Make the schema update SQL texts be in an array so we can loop
* Make the version update statement generic, not cloned-and-hacked
This will make it possible to add another schema version without
error-prone conditions etc.
|
| | |
|
| |\
| |
| |
| |
| |
| |
| | |
Clean up some errors in tor-dirmgr
Closes #521
See merge request tpo/core/arti!628
|
| | | |
|
| | | |
|
| | | |
|
| |/ |
|
| | |
|