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

chore: update cargo deps #553

Merged
merged 2 commits into from
Dec 26, 2023
Merged

Conversation

da2ce7
Copy link
Contributor

@da2ce7 da2ce7 commented Dec 26, 2023

Updating crates.io index
    Updating axum v0.6.20 -> v0.7.2
    Updating axum-client-ip v0.4.2 -> v0.5.0
    Updating axum-core v0.3.4 -> v0.4.1
    Updating axum-macros v0.3.8 -> v0.4.0
    Updating axum-server v0.5.1 -> v0.6.0
      Adding h2 v0.4.0
      Adding http-body-util v0.1.0
    Removing http-range-header v0.3.1
      Adding hyper-util v0.1.2
    Updating rustls-pemfile v1.0.4 -> v2.0.0
      Adding rustls-pki-types v1.1.0
    Updating tower-http v0.4.4 -> v0.5.0
Updating crates.io index
    Updating anstream v0.6.4 -> v0.6.5
    Updating anstyle-parse v0.2.2 -> v0.2.3
    Updating anstyle-query v1.0.0 -> v1.0.2
    Updating anstyle-wincon v3.0.1 -> v3.0.2
    Updating async-trait v0.1.74 -> v0.1.75
    Updating borsh v1.2.0 -> v1.3.0
    Updating borsh-derive v1.2.0 -> v1.3.0
    Updating clap v4.4.10 -> v4.4.11
    Updating clap_builder v4.4.9 -> v4.4.11
    Updating crossbeam v0.8.2 -> v0.8.3
    Updating crossbeam-channel v0.5.8 -> v0.5.10
    Updating crossbeam-deque v0.8.3 -> v0.8.4
    Updating crossbeam-epoch v0.9.15 -> v0.9.17
    Updating crossbeam-queue v0.3.8 -> v0.3.10
    Updating crossbeam-utils v0.8.16 -> v0.8.18
    Updating deranged v0.3.9 -> v0.3.10
    Removing difflib v0.4.0
    Removing float-cmp v0.9.0
    Updating futures v0.3.29 -> v0.3.30
    Updating futures-channel v0.3.29 -> v0.3.30
    Updating futures-core v0.3.29 -> v0.3.30
    Updating futures-executor v0.3.29 -> v0.3.30
    Updating futures-io v0.3.29 -> v0.3.30
    Updating futures-macro v0.3.29 -> v0.3.30
    Updating futures-sink v0.3.29 -> v0.3.30
    Updating futures-task v0.3.29 -> v0.3.30
    Updating futures-util v0.3.29 -> v0.3.30
    Updating http-body v0.4.5 -> v0.4.6
    Updating hyper v0.14.27 -> v0.14.28
      Adding itertools v0.11.0
    Updating itoa v1.0.9 -> v1.0.10
    Updating libc v0.2.150 -> v0.2.151
    Removing memoffset v0.9.0
    Updating mio v0.8.9 -> v0.8.10
    Updating mockall v0.11.4 -> v0.12.1
    Updating mockall_derive v0.11.4 -> v0.12.1
    Removing normalize-line-endings v0.3.0
    Updating object v0.32.1 -> v0.32.2
    Updating once_cell v1.18.0 -> v1.19.0
    Updating openssl v0.10.60 -> v0.10.62
    Updating openssl-src v300.1.6+3.1.4 -> v300.2.1+3.2.0
    Updating openssl-sys v0.9.96 -> v0.9.98
    Updating pkg-config v0.3.27 -> v0.3.28
    Updating predicates v2.1.5 -> v3.0.4
    Updating proc-macro2 v1.0.70 -> v1.0.71
    Updating reqwest v0.11.22 -> v0.11.23
    Updating ring v0.17.6 -> v0.17.7
    Updating rkyv v0.7.42 -> v0.7.43
    Updating rkyv_derive v0.7.42 -> v0.7.43
    Updating rustix v0.38.26 -> v0.38.28
    Updating rustls v0.21.9 -> v0.21.10
    Updating ryu v1.0.15 -> v1.0.16
    Updating serde_spanned v0.6.4 -> v0.6.5
    Removing socket2 v0.4.10
    Updating syn v2.0.39 -> v2.0.43
    Updating thiserror v1.0.50 -> v1.0.52
    Updating thiserror-impl v1.0.50 -> v1.0.52
    Updating time v0.3.30 -> v0.3.31
    Updating time-macros v0.2.15 -> v0.2.16
    Updating tokio v1.34.0 -> v1.35.1
    Updating try-lock v0.2.4 -> v0.2.5
    Updating unicode-bidi v0.3.13 -> v0.3.14
    Updating winnow v0.5.19 -> v0.5.30
    Updating zerocopy v0.7.28 -> v0.7.32
    Updating zerocopy-derive v0.7.28 -> v0.7.32

```
Updating crates.io index
    Updating anstream v0.6.4 -> v0.6.5
    Updating anstyle-parse v0.2.2 -> v0.2.3
    Updating anstyle-query v1.0.0 -> v1.0.2
    Updating anstyle-wincon v3.0.1 -> v3.0.2
    Updating async-trait v0.1.74 -> v0.1.75
    Updating borsh v1.2.0 -> v1.3.0
    Updating borsh-derive v1.2.0 -> v1.3.0
    Updating clap v4.4.10 -> v4.4.11
    Updating clap_builder v4.4.9 -> v4.4.11
    Updating crossbeam v0.8.2 -> v0.8.3
    Updating crossbeam-channel v0.5.8 -> v0.5.10
    Updating crossbeam-deque v0.8.3 -> v0.8.4
    Updating crossbeam-epoch v0.9.15 -> v0.9.17
    Updating crossbeam-queue v0.3.8 -> v0.3.10
    Updating crossbeam-utils v0.8.16 -> v0.8.18
    Updating deranged v0.3.9 -> v0.3.10
    Removing difflib v0.4.0
    Removing float-cmp v0.9.0
    Updating futures v0.3.29 -> v0.3.30
    Updating futures-channel v0.3.29 -> v0.3.30
    Updating futures-core v0.3.29 -> v0.3.30
    Updating futures-executor v0.3.29 -> v0.3.30
    Updating futures-io v0.3.29 -> v0.3.30
    Updating futures-macro v0.3.29 -> v0.3.30
    Updating futures-sink v0.3.29 -> v0.3.30
    Updating futures-task v0.3.29 -> v0.3.30
    Updating futures-util v0.3.29 -> v0.3.30
    Updating http-body v0.4.5 -> v0.4.6
    Updating hyper v0.14.27 -> v0.14.28
      Adding itertools v0.11.0
    Updating itoa v1.0.9 -> v1.0.10
    Updating libc v0.2.150 -> v0.2.151
    Removing memoffset v0.9.0
    Updating mio v0.8.9 -> v0.8.10
    Updating mockall v0.11.4 -> v0.12.1
    Updating mockall_derive v0.11.4 -> v0.12.1
    Removing normalize-line-endings v0.3.0
    Updating object v0.32.1 -> v0.32.2
    Updating once_cell v1.18.0 -> v1.19.0
    Updating openssl v0.10.60 -> v0.10.62
    Updating openssl-src v300.1.6+3.1.4 -> v300.2.1+3.2.0
    Updating openssl-sys v0.9.96 -> v0.9.98
    Updating pkg-config v0.3.27 -> v0.3.28
    Updating predicates v2.1.5 -> v3.0.4
    Updating proc-macro2 v1.0.70 -> v1.0.71
    Updating reqwest v0.11.22 -> v0.11.23
    Updating ring v0.17.6 -> v0.17.7
    Updating rkyv v0.7.42 -> v0.7.43
    Updating rkyv_derive v0.7.42 -> v0.7.43
    Updating rustix v0.38.26 -> v0.38.28
    Updating rustls v0.21.9 -> v0.21.10
    Updating ryu v1.0.15 -> v1.0.16
    Updating serde_spanned v0.6.4 -> v0.6.5
    Removing socket2 v0.4.10
    Updating syn v2.0.39 -> v2.0.43
    Updating thiserror v1.0.50 -> v1.0.52
    Updating thiserror-impl v1.0.50 -> v1.0.52
    Updating time v0.3.30 -> v0.3.31
    Updating time-macros v0.2.15 -> v0.2.16
    Updating tokio v1.34.0 -> v1.35.1
    Updating try-lock v0.2.4 -> v0.2.5
    Updating unicode-bidi v0.3.13 -> v0.3.14
    Updating winnow v0.5.19 -> v0.5.30
    Updating zerocopy v0.7.28 -> v0.7.32
    Updating zerocopy-derive v0.7.28 -> v0.7.32
```
Copy link

codecov bot commented Dec 26, 2023

Codecov Report

Attention: 21 lines in your changes are missing coverage. Please review.

Comparison is base (2b859d6) 79.58% compared to head (14cb26c) 79.32%.

Files Patch % Lines
src/servers/http/v1/launcher.rs 0.00% 10 Missing ⚠️
src/servers/apis/server.rs 47.05% 9 Missing ⚠️
src/servers/health_check_api/server.rs 81.81% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #553      +/-   ##
===========================================
- Coverage    79.58%   79.32%   -0.27%     
===========================================
  Files          117      117              
  Lines         7750     7786      +36     
===========================================
+ Hits          6168     6176       +8     
- Misses        1582     1610      +28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@da2ce7
Copy link
Contributor Author

da2ce7 commented Dec 26, 2023

@josecelano

The test health_check_endpoint_should_return_status_ok_when_no_service_is_running is failing.
If possible can you please review why it is now failing after this update.

@josecelano
Copy link
Member

@josecelano

The test health_check_endpoint_should_return_status_ok_when_no_service_is_running is failing. If possible can you please review why it is now failing after this update.

Hi @da2ce7 I do not know why it was passing yet. The ephemeral configuration uses port 0, which uses a free port but after starting the Health Check API server it returns the port in the configuration (0) instead of the actual port the socket was bound to. So the test should fail.

I've created a new issue to fix it: #554

In the develop branch is passing. I'm going to try to find out why is passing.

@josecelano
Copy link
Member

Hi @da2ce7 the problem is the following line was removed:

let bound_addr = server.local_addr();

And that's the line to get the actual bound address. I thought it was not included in the develop branch either, but It was. In fact, that's one of the reasons I did not update dependencies some days ago and I opened this issue: #510

develop branch version:

    socket_addr: SocketAddr,
    tx: Sender<ApiServerJobStarted>,
    config: Arc<Configuration>,
) -> impl Future<Output = hyper::Result<()>> {
    let app = Router::new()
        .route("/", get(|| async { Json(json!({})) }))
        .route("/health_check", get(health_check_handler))
        .with_state(config);

    let server = axum::Server::bind(&socket_addr).serve(app.into_make_service());

    let bound_addr = server.local_addr();

    info!("Health Check API server listening on http://{}", bound_addr);

    let running = server.with_graceful_shutdown(async move {
        tokio::signal::ctrl_c().await.expect("Failed to listen to shutdown signal.");
        info!("Stopping Torrust Health Check API server o http://{} ...", socket_addr);
    });

    tx.send(ApiServerJobStarted { bound_addr })
        .expect("the Health Check API server should not be dropped");

    running
}

This PR version:

pub fn start(
    socket_addr: SocketAddr,
    tx: Sender<ApiServerJobStarted>,
    config: Arc<Configuration>,
) -> impl Future<Output = Result<(), std::io::Error>> {
    let app = Router::new()
        .route("/", get(|| async { Json(json!({})) }))
        .route("/health_check", get(health_check_handler))
        .with_state(config);

    let handle = Handle::new();

    let cloned_handle = handle.clone();

    tokio::task::spawn(async move {
        tokio::signal::ctrl_c().await.expect("Failed to listen to shutdown signal.");
        info!("Stopping Torrust Health Check API server o http://{} ...", socket_addr);
        cloned_handle.shutdown();
    });

    let running = axum_server::bind(socket_addr)
        .handle(handle)
        .serve(app.into_make_service_with_connect_info::<SocketAddr>());

    tx.send(ApiServerJobStarted { bound_addr: socket_addr })
        .expect("the Health Check API server should not be dropped");

    running
}

```
    Updating crates.io index
    Updating axum v0.6.20 -> v0.7.2
    Updating axum-client-ip v0.4.2 -> v0.5.0
    Updating axum-core v0.3.4 -> v0.4.1
    Updating axum-macros v0.3.8 -> v0.4.0
    Updating axum-server v0.5.1 -> v0.6.0
      Adding h2 v0.4.0
      Adding http-body-util v0.1.0
    Removing http-range-header v0.3.1
      Adding hyper-util v0.1.2
    Updating rustls-pemfile v1.0.4 -> v2.0.0
      Adding rustls-pki-types v1.1.0
    Updating tower-http v0.4.4 -> v0.5.0
```
@da2ce7
Copy link
Contributor Author

da2ce7 commented Dec 26, 2023

@josecelano thanks, fixed now.

@josecelano
Copy link
Member

ACK 14cb26c

@josecelano josecelano self-requested a review December 26, 2023 16:30
Comment on lines +84 to 87
tokio::task::spawn(async move {
shutdown_signal.await;
cloned_handle.shutdown();
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @da2ce7 I think one tests was failing because of the spwan_localbut only in the runner. See #521. Maybe it does not fail after changing this.

@josecelano josecelano merged commit f6f07b4 into torrust:develop Dec 26, 2023
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants