add a warning to help us find when we forget to drop explicitely drop a permit

This commit is contained in:
Tamo 2024-08-28 14:37:55 +02:00
parent 1b90e6ce5f
commit 241746e7f4

View File

@ -49,6 +49,7 @@ impl Permit {
impl Drop for Permit {
fn drop(&mut self) {
tracing::warn!("Internal error, a search permit was lazily dropped. If you see this message, please open an issue on the meilisearch repository at <https://github.com/meilisearch/meilisearch/issues/new?template=bug_report.md&title=[INTERNAL%20ERROR]%20Meilisearch%20lazily%20dropped%20a%20search%20permit>");
let sender = self.sender.clone();
// if the channel is closed then the whole instance is down
std::mem::drop(tokio::spawn(async move { sender.send(()).await }));