We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e0d7c02 commit 2036189Copy full SHA for 2036189
1 file changed
src/scheduler.rs
@@ -389,9 +389,10 @@ where
389
///
390
/// - [`CanoError::Workflow`] — the scheduler is not running
391
pub async fn stop(&self) -> CanoResult<()> {
392
- // Send stop signal — non-blocking; fails immediately if channel is full or disconnected
+ // Send stop signal — use send().await to ensure delivery for critical control-plane command.
393
+ // This is safe because stop signals are rare and waiting for queue space is acceptable.
394
if let Some(tx) = self.command_tx.read().await.as_ref() {
- tx.try_send(SchedulerCommand::Stop)
395
+ tx.send(SchedulerCommand::Stop).await
396
.map_err(|e| CanoError::Workflow(format!("Failed to send stop: {}", e)))?;
397
} else {
398
return Err(CanoError::Workflow(
0 commit comments