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

fix: Initialize rustls's CryptoProvider early in the code #2312

Merged
merged 3 commits into from
Jan 8, 2025

Conversation

BulkBeing
Copy link
Contributor

@BulkBeing BulkBeing commented Jan 8, 2025

The rustls crate is used to generate SSL certs for metrics server of the monovertex. The metrics server handles /metrics and all the k8s health check endpoints (/livez, /readyz and /sidecar-livez). Since the CryptoProvider was not initialized, rustls was crashing:

2025-01-08T07:00:47.475519Z  INFO numaflow_core::source: Started streaming source with batch size: 500
thread 'tokio-runtime-worker' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/rustls-0.23.19/src/crypto/mod.rs:249:14:
no process-level CryptoProvider available -- call CryptoProvider::install_default() before this point
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'tokio-runtime-worker' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/axum-server-0.7.1/src/tls_rustls/mod.rs:192:14:
called `Result::unwrap()` on an `Err` value: JoinError::Panic(Id(43), "no process-level CryptoProvider available -- call CryptoProvider::install_default() before this point", ...)

We were initializing it in specific paths (eg. serving also generates self-signed certs). I'm moving it to the main.rs in this PR.
Verified by running https://github.com/numaproj/numaflow/blob/main/test/monovertex-e2e/testdata/mono-vertex-with-transformer.yaml and https://github.com/numaproj/numaflow/blob/main/examples/21-simple-mono-vertex.yaml.

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 40.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 67.09%. Comparing base (5f5af1b) to head (0bcf35d).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
rust/numaflow/src/main.rs 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2312      +/-   ##
==========================================
- Coverage   67.12%   67.09%   -0.03%     
==========================================
  Files         351      351              
  Lines       45275    45273       -2     
==========================================
- Hits        30391    30377      -14     
- Misses      13817    13829      +12     
  Partials     1067     1067              

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

@BulkBeing BulkBeing marked this pull request as ready for review January 8, 2025 07:27
@vigith vigith merged commit b6c4de1 into main Jan 8, 2025
28 checks passed
@vigith vigith deleted the mvtx-metrics-server-bug branch January 8, 2025 13:08
SaniyaKalamkar pushed a commit to SaniyaKalamkar/numaflow that referenced this pull request Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants