You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the tls-rustls-reload loads the certificates just once at the startup, it never re-attempts to go thru the loop inside the async stream again.
To Reproduce
This little code change makes it more clear, set the reloading duration to 1sec and put some debug messages around. The messages are seen only once as the sleep await is never woke up.
Apparently the tls is reloaded when the server is in use, e.g. by issuing curl on the / endpoint. So maybe it's expected behavior but might be noted in the doc.
I believe that the stream created is not awaiting without use. To achieve the result you want, it is necessary to create a separate background task that will constantly work and be expected by someone. You can come up with a solution using tokio::sync::mpsc, when a stream for rustls(...) expects an answer from the channel, and the background task throws the data into the channel (the main thing is to constantly read the channel to avoid its overflow); Arc<Mutex<...>> is also acceptable. In essence, you can make a timer in Arc<Mutex<...>>, which will allow you to determine whether a certain time has passed, and then re-read the configuration and yield, or continue to wait for the timer.
Describe the bug
the tls-rustls-reload loads the certificates just once at the startup, it never re-attempts to go thru the loop inside the async stream again.
To Reproduce
This little code change makes it more clear, set the reloading duration to 1sec and put some debug messages around. The messages are seen only once as the sleep await is never woke up.
Expected behavior
I assume we want to see messages to appear every 1s tick.
Screenshots
Desktop (please complete the following information):
OS: Ubuntu 23.10
rustc version:
The text was updated successfully, but these errors were encountered: