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: ensure consumers of policy-fetcher can compile #201

Merged

Conversation

flavio
Copy link
Member

@flavio flavio commented Jul 17, 2024

Under special circumstances, some code that makes uses of policy-fetcher does not compile.

That happens when the consumer of policy-fetcher is created inside of a tokio task with tokio::spawn().

That happens because the private url_fetcher takes as a parameter something that implements the PolicyFetcher trait, but is not explicit about requiring also the Send attribute. The Send attribute is required by tokio to move the task between its worker threads.

Once this is merged I'll tag a new patch release of the crate. This is required by the integration tests of policy-server to test the certificate reload.

Under special circumstances, some code that makes uses of
policy-fetcher does not compile.

That happens when the consumer of policy-fetcher is created inside of a
tokio task with `tokio::spawn()`.

That happens because the private `url_fetcher` takes as a parameter
something that implements the `PolicyFetcher` trait, but is not explicit
about requiring also the `Send` attribute. The `Send` attribute is
required by tokio to move the task between its worker threads.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
@flavio flavio requested a review from a team as a code owner July 17, 2024 16:15
@flavio flavio self-assigned this Jul 17, 2024
@flavio flavio merged commit e7190fc into kubewarden:main Jul 17, 2024
8 checks passed
@flavio flavio deleted the fix-compilation-issues-when-spawning-tokio-task branch July 17, 2024 16:50
@flavio
Copy link
Member Author

flavio commented Jul 17, 2024

thanks @jvanz

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