Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Krator Does not use Notify Properly #4

Closed
kflansburg opened this issue May 21, 2021 · 1 comment · Fixed by #54
Closed

Krator Does not use Notify Properly #4

kflansburg opened this issue May 21, 2021 · 1 comment · Fixed by #54
Labels
bug Something isn't working
Milestone

Comments

@kflansburg
Copy link
Member

In krator/src/runtime.rs, tokio::sync::Notify is expected to always return instantly after it has been notified, rather than its actual behavior of waiting for a new notification. This results in the task getting stuck in some cases waiting for events to happen when they already have. Change to using a RwLock<bool>, or something similar.

@kflansburg kflansburg added the bug Something isn't working label May 21, 2021
@kflansburg kflansburg added this to the 0.4.0 milestone May 25, 2021
@kflansburg
Copy link
Member Author

Confirmed still an issue.

To reproduce:

  1. Switch to Nightly Rust (required by Tokio console)

  2. Checkout branch kflansburg/tokio-console, then run:

RUSTFLAGS="--cfg tokio_unstable" RUST_LOG=tokio::task=trace cargo run --example moose --features=derive -- --console
  1. Clone and run console in another shell.

  2. Use examples/assets/generate_random_meese.py 10 to create 10+ resources managed by the controller. (there is a requirements file to install Python deps).

  3. Delete all resources: kubectl delete mooses --all.

You should observe a tasks related to individual resources stick around forever. There are two main task entrypoints:

  • src/runtime.rs:222
  • src/runtime.rs:181

The one at line 222 is the one getting stuck, and I believe it is because of the notification behavior mentioned above.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant