Tracker Checker: check UDP trackers#664
Merged
josecelano merged 11 commits intotorrust:developfrom Feb 1, 2024
Merged
Conversation
2 tasks
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #664 +/- ##
===========================================
- Coverage 73.71% 73.05% -0.66%
===========================================
Files 138 143 +5
Lines 9065 9164 +99
===========================================
+ Hits 6682 6695 +13
- Misses 2383 2469 +86 ☔ View full report in Codecov by Sentry. |
aabfedb to
82ec491
Compare
82ec491 to
7225dbe
Compare
The output for the UDP tracker checks are now the same as the HTTP tracker checks. But not implemented yet (TODO). ```output Running checks for trackers ... UDP trackers ... ✓ - Announce at 127.0.0.1:6969 is OK ✓ - Scrape at 127.0.0.1:6969 is OK HTTP trackers ... ✓ - Announce at http://127.0.0.1:7070/ is OK (TODO) ✓ - Scrape at http://127.0.0.1:7070/ is OK (TODO) Health checks ... ✓ - Health API at http://127.0.0.1:1313/health_check is OK ```
…eck UDP servers It will be used in teh Tracker Checker too.
for serialization to JSON.
ce9e2e8 to
1b92b77
Compare
It allows simplifying the wasy we build InfoHashes from hex strings:
```rust
let info_hash = InfoHash(hex!("9c38422213e30bff212b30c360d26f9a02136422")); // # DevSkim: ignore DS173237
```
This is the first working implementation. WIP. TODO: - Refactor: reorganize code: big functions, etc. - Bugs: if the UDP server is down the checker waits forever. Probably there is a missing timeout for the connection request. And in general for all requests.
The generic UDP client does not have timeouts. When the server is down it waits forever for responses. This client has been using only for testing where the server was always up, but now it's using in production code by the Tracker Checker. For the time being, I keep the panicking behavior of the UdpClient when something is wrong. However we should return an error when the operation times out. For the Tracker Checker, it means that when the checker can't connect to a UDP server the checker is going to panic after 5 seconds. That is not the intended behavior for the checker. It should always return a full reprot of all checks. In order to implement that behavior we need to change the UdpClient to return errors. Since that's a bug refactor I open a new issue.
Member
Author
|
ACK 873f98d |
Member
Author
|
Hi @da2ce7 there is still a lot to improve but I want to merge this PR asap because this version runs all the checks: HTTP tracker, UDP Tracker and Health Checks. This PR adds the UDP checks. We are running the checker in the E2E tests and this ensures that the UDP service is working correctly. I will open a new epic issue with all the improvements/changes we can make in the short and long term. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add checks for UDP trackers to the Tracker Checker.
The output will look like the following:
See subtasks in #639