aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-hsservice/src/timeout_track.rs
Commit message (Collapse)AuthorAgeFilesLines
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* tor-hssrvice: port to web-time-compat.Nick Mathewson2026-03-261-2/+3
|
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-041-1/+1
|
* clippy: fix `clippy::duplicated_attributes` warningsSteven Engler2025-08-111-2/+0
| | | | | | | | | | ```text warning: duplicated attribute --> crates/tor-hsservice/src/timeout_track.rs:630:14 | 630 | #![allow(clippy::needless_pass_by_value)] // TODO hoist into standard lint block | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ```
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-2/+2
| | | | | | | | | | | | | | 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.
* tor-rtcompat: Rename BlockOn to ToplevelBlockOnIan Jackson2025-03-041-2/+2
| | | | | | | | | | We're going to distinguish top-level runtime entry, from *re*-entry to an existing executor. It is most convenient to rename this trait first. Documentation of the distinction will come later. (We're going to retain the function name `block_on`, but we want the trait to be more obviously a top-level only thing, though, so we give it a name that will hopefully avoid it peroulating throughout the codebase..)
* extract tor_async_utils::oneshot into ::oneshot-fused-workaroundJim Newsome2024-08-281-1/+1
| | | | | | | | | | | | | | 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.
* Change deftly syntax to post 0.12.1 versionIan Jackson2024-06-171-3/+3
| | | | | | | | | | | * Change `pub` to `export` * Change the `=` in define to `:` * Change `pub_template_semver_check` to `template_export_semver_check` Right now, 0.12.1 supports both syntaxes. I have verified this branch also compiles with https://gitlab.torproject.org/Diziet/rust-derive-deftly/-/merge_requests/402 ee171ffaf56d7dcb7d75584054921153fe19b222
* Update to derive-deftly 0.12.1Ian Jackson2024-06-171-4/+4
| | | | | | * Bump in Cargo.toml * Deal with `${Xmeta as ...}` incompatible change, by always specifying an `as`, and changing `as tokens`.
* derive-deftly: Change some docs referencesIan Jackson2024-04-031-2/+2
| | | | Found by "git grep adhoc" and manual inspection.
* Switch to derive-deftlyIan Jackson2024-04-031-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the combination of a number of separate commits, many of which were generated by seddery, and then rebased and squashed. Cargo.toml perl -i~ -pe 's{^derive-adhoc}{derive-deftly = "0.10"}' crates/*/Cargo.toml (not regenerated during rebase) update Cargo.lock `cargo fetch` without --locked (regenerated during rebase) seddery git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{^use derive_adhoc}{use derive_deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bdefine_derive_adhoc\b}{define_derive_deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bAdhoc\b}{Deftly}g if m{derive}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\#\[derive_adhoc\b}{#[derive_deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{use derive_adhoc}{use derive_deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc\b}{derive_deftly_adhoc} if m{use.*deftly}' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc!}{derive_deftly_adhoc!}' (not regenerated during rebase) Manually add `#[derive_deftly_adhoc]` where needed. seddery git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\#\[adhoc\b}{#[deftly}g' git-ls-files | grep '\.rs$' | xargs perl -i~ -pe 's{\bderive_adhoc_template}{derive_deftly_template}' (not regenerated during rebase) Manually fix up an import Manually update some builder attrs Manually fix up tor_rtmock::time_core This was missed in my seddery, due to me rebasing the branch and not redoing the seddery.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* tor-hsservice: timeout_track: Remove some unnecessary allowsIan Jackson2023-11-011-3/+1
| | | | Retain the TODO for making this properly pub somewhere.
* tor-hsservice: Remove unnecessary clone()s.Gabriela Moldovan2023-10-311-3/+3
| | | | | `cargo clippy --all-features --tests` is reporting warnings about the unnecessary cloning.
* Fix typo in doc commentgabi-2502023-10-301-1/+1
|
* tor-hsservice: timeout_track: Test `update` functionsIan Jackson2023-10-301-2/+30
|
* tor-hsservice: timeout_track: Provide `update` via a traitIan Jackson2023-10-301-25/+53
| | | | | | | | We have a profusion of similar methods with similar names and similar documentation. Centralising the documentation in a trait is helpful. This also means that callers can just naturally call `.update` rather than needing to spell out `.update_abs` vs `.update_rel` etc.
* tor-hsservice: timeout_track: Clarify edge casesIan Jackson2023-10-301-2/+4
| | | | | Clarify this in the update functions, and in the general discussion. We don't want zero timeouts.
* tor-hsservice: timeout track: Worsify formattingIan Jackson2023-10-161-4/+6
| | | | | | | | Simply running `rustfmt` makes a mess. This new formatting is less nice but repo policy requires that the layout is a fixed point under rustfmt and this is the least bad fixed point I found.
* tor-hsservice: timeout track: Add some discussionIan Jackson2023-10-161-4/+36
|
* tor-hsservice: timeout track: Add an example doctestIan Jackson2023-10-161-0/+60
|
* tor-hsservice: timeout track: Add a rustdoc allowIan Jackson2023-10-161-0/+4
| | | | Suppresses some erroneous warnings.
* tor-hsservice: timeout_track: Add a TODO re explanationsIan Jackson2023-10-161-0/+3
|
* tor-hsservice: Apply mandatory code formatting worseningIan Jackson2023-10-161-5/+3
|
* tor-hsservice: timeout_track: tests: Introduce secs() aliasIan Jackson2023-10-161-11/+14
| | | | I wish we could `use Duration::from_secs as secs`.
* tor-hsservice: timeout_track: Change semantics to do what's neededIan Jackson2023-10-161-32/+68
| | | | | | | | | | | | | | | | | The key point is this: +//! I.e., the timeout tracker tells you when (in the future) +//! any of the comparisons you have made, might produce different answers. +//! So, that can be used to know how long to sleep for when waiting for timeout(s). That's how the code in ipt_mgr.rs uses this. Without this change, things go wrong in the following case: we've got at least one good IPT, but not quite enough, and the others are taking too long. Ie, the timeout for "we should publish" is in the past. We decide to publish (correctly) but this *past* timeout should be disregarded. Disregarding past timeouts is correct if the code which is making the comparisons acts on the timeout when it occurs.
* tor-hsservice: timeout_track: Provided shortest() for all trackersIan Jackson2023-10-161-0/+25
|
* tor-hsservice: timeout_track: Mark some unused variablesIan Jackson2023-10-161-2/+2
|
* tor-hsservice: timeout_track: Add a dead code allowIan Jackson2023-10-161-0/+1
| | | | For the same reason as the allow(unreachable_pub).
* oneshot: Apply deferred rustfmt churnIan Jackson2023-10-111-1/+1
| | | | cargo fmt, precisely.
* oneshot: Use veneer in tor-hsserviceIan Jackson2023-10-111-1/+1
|
* oneshot: Avoid (one) use of .try_recv()Ian Jackson2023-10-111-2/+4
| | | | | | It's not so straightforward to provide this (we'd need to poll the FusedFuture and make a dummy a Context and so on), but this is just used once in a test where we can replace it with use of `poll!`
* tor-rtmock: Rename MockRuntime::jump_to to jump_wallclockIan Jackson2023-10-031-1/+1
| | | | | | This was named after the method from MockSleepRuntime. The name is confusing because it seems to imply it might do something to the monotonic time.
* tor-hsservice: timeout_track test: Use advance_byIan Jackson2023-09-181-1/+2
|
* Rerun maint/add_warningIan Jackson2023-08-231-0/+1
| | | | | Fixes CI. There was a semantic conflict between !1535 (which added a suppression) and !1523 (which added a new module).
* tor-hsservice: timeout_track: Add some TODOsIan Jackson2023-08-231-0/+3
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1523#note_2934299
* tor-hsservice: ipt-m: tests: Fix wrong commentIan Jackson2023-08-231-1/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1523#note_2934298
* Fix doc formatting.gabi-2502023-08-231-1/+1
|
* tor-hsservice: Provide timeout tracking utilities - testsIan Jackson2023-08-231-2/+199
|
* tor-hsservice: Provide timeout tracking utilitiesIan Jackson2023-08-231-0/+431
This module is perhaps rather more comprehensive than needed right now. But I found I kept wanting to change which bits of it I used.