File tree Expand file tree Collapse file tree
crates/forge_app/src/hooks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,9 +105,14 @@ impl<S: AgentService> EventHandle<EventData<EndPayload>> for TitleGenerationHand
105105
106106impl < S > Drop for TitleGenerationHandler < S > {
107107 fn drop ( & mut self ) {
108- // Clearing the map drops all `JoinHandle`s (aborting the spawned
109- // tasks) and `oneshot::Receiver`s. The tasks will observe a closed
110- // channel on `tx.send()` and exit gracefully.
108+ // Explicitly abort every spawned task before clearing the map.
109+ // Dropping a `JoinHandle` does *not* abort the underlying Tokio task —
110+ // the task would keep running until completion. Calling `.abort()`
111+ // ensures the tasks are cancelled immediately so the runtime can
112+ // shut down cleanly without waiting for pending LLM calls.
113+ for entry in self . title_tasks . iter ( ) {
114+ entry. handle . abort ( ) ;
115+ }
111116 self . title_tasks . clear ( ) ;
112117 }
113118}
You can’t perform that action at this time.
0 commit comments