Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the seeder command more resilience to connection errors #470

Open
1 of 2 tasks
josecelano opened this issue Feb 8, 2024 · 1 comment
Open
1 of 2 tasks

Make the seeder command more resilience to connection errors #470

josecelano opened this issue Feb 8, 2024 · 1 comment
Labels
Milestone

Comments

@josecelano
Copy link
Member

josecelano commented Feb 8, 2024

Relates to:

The seeder command panics when connection is refused by the server.

2024-02-08T12:00:42.181187698+00:00 [seeder][INFO] Uploading torrent #490 ...
2024-02-08T12:00:42.181278716+00:00 [seeder][INFO] Uploading torrent with uuid: 06003a9e-d76e-4ca6-8b45-f05d22a817a3 ...
thread 'main' panicked at /home/josecelano/Documents/git/commiter/me/github/torrust/torrust-index/src/web/api/client/v1/client.rs:181:18:
called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Request, url: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("index.torrust-demo.com")), port: None, path: "/api/v1/category", query: None, fragment: None }, source: hyper::Error(Connect, ConnectError("tcp connect error", Os { code: 111, kind: ConnectionRefused, message: "Connection refused" })) }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

We should catch that error and retry later. This is related to #467. The API Client should return an error instead of panicking.

@josecelano josecelano added this to the v3.0.0 milestone Feb 8, 2024
@josecelano
Copy link
Member Author

After merging #482 now we can catch timeout errors from the API client and retry (N times) with an interval of I seconds between attempts.

@josecelano josecelano modified the milestones: v3.0.0, v3.1.0 Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

1 participant