File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
lib/bindings/python/rust/llm/block_manager/distributed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ impl KvbmLeader {
6868impl KvbmLeader {
6969 #[ new]
7070 #[ pyo3( signature = ( world_size, drt) ) ]
71- fn new ( world_size : usize , drt : DistributedRuntime ) -> PyResult < Self > {
71+ fn new ( py : Python < ' _ > , world_size : usize , drt : DistributedRuntime ) -> PyResult < Self > {
7272
7373 let barrier_id_prefix = get_barrier_id_prefix ( ) ;
7474 let leader_init_timeout_sec: u64 =
@@ -86,8 +86,11 @@ impl KvbmLeader {
8686
8787 let rt = drt. inner ( ) . runtime ( ) . primary ( ) ;
8888
89- let leader =
90- rt. block_on ( async move { KvbmLeaderImpl :: new ( config) . await . map_err ( to_pyerr) } ) ?;
89+ let leader = py. allow_threads ( || {
90+ rt. block_on ( async move {
91+ KvbmLeaderImpl :: new ( config) . await
92+ } )
93+ } ) . map_err ( to_pyerr) ?;
9194
9295 Ok ( Self {
9396 leader : Arc :: new ( leader) ,
You can’t perform that action at this time.
0 commit comments