Skip to content

Commit d4fa0ab

Browse files
committed
fix(v8-runtime): drop channel sender before join in destroy_session to prevent deadlock
1 parent 779bed7 commit d4fa0ab

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

native/v8-runtime/src/session.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,11 @@ impl SessionManager {
169169
));
170170
}
171171

172-
// Send shutdown and join
172+
// Send shutdown, drop the sender so the session thread's rx.recv()
173+
// returns Err if Shutdown was consumed by an inner loop, then join.
173174
let _ = entry.tx.send(SessionCommand::Shutdown);
174175
let mut entry = self.sessions.remove(session_id).unwrap();
176+
drop(entry.tx);
175177
if let Some(handle) = entry.join_handle.take() {
176178
let _ = handle.join();
177179
}

0 commit comments

Comments
 (0)