Skip to content

Expose shutdown lifecycle on ChitchatHandle#162

Merged
fulmicoton-dd merged 3 commits intomainfrom
server-shutdown-init
Jul 10, 2025
Merged

Expose shutdown lifecycle on ChitchatHandle#162
fulmicoton-dd merged 3 commits intomainfrom
server-shutdown-init

Conversation

@rdettai
Copy link
Collaborator

@rdettai rdettai commented Jun 25, 2025

To handle chitchat failures and panics in QW, we need to be able to watch its state (quickwit-oss/quickwit#5819)

@rdettai rdettai requested a review from guilload June 25, 2025 10:26
let chitchat_arc = Arc::new(Mutex::new(chitchat));
let chitchat_arc_clone = chitchat_arc.clone();

let (termination_watcher_sender, termination_watcher) = watch::channel(None);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let (termination_watcher_sender, termination_watcher) = watch::channel(None);
let (termination_watcher_sender, termination_watcher) = watch::channel(None);

I think that codebase adopts the _tx for sender and _rx for receiver naming scheme.
It is confusing, but common in rust.

}

pub fn termination_watcher(&self) -> impl Future<Output = anyhow::Result<()>> {
let mut watcher = self.termination_watcher.clone();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an alternative implementation could have been to add a deps to the futures crate and rely on future::shared() over the JoinHandle.

@fulmicoton-dd fulmicoton-dd merged commit e632b15 into main Jul 10, 2025
4 of 5 checks passed
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.

2 participants