Add logs around blocking runtime shutdown
This commit is contained in:
		| @@ -582,8 +582,16 @@ struct InnerClientHandle { | |||||||
|  |  | ||||||
| impl Drop for InnerClientHandle { | impl Drop for InnerClientHandle { | ||||||
|     fn drop(&mut self) { |     fn drop(&mut self) { | ||||||
|  |         let id = self.thread | ||||||
|  |             .as_ref() | ||||||
|  |             .map(|h| h.thread().id()) | ||||||
|  |             .expect("thread not dropped yet"); | ||||||
|  |  | ||||||
|  |         trace!("closing runtime thread ({:?})", id); | ||||||
|         self.tx.take(); |         self.tx.take(); | ||||||
|  |         trace!("signaled close for runtime thread ({:?})", id); | ||||||
|         self.thread.take().map(|h| h.join()); |         self.thread.take().map(|h| h.join()); | ||||||
|  |         trace!("closed runtime thread ({:?})", id); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -629,10 +637,14 @@ impl ClientHandle { | |||||||
|                         tokio::spawn(forward(req_fut, req_tx)); |                         tokio::spawn(forward(req_fut, req_tx)); | ||||||
|                     } |                     } | ||||||
|  |  | ||||||
|                     trace!("Receiver is shutdown"); |                     trace!("({:?}) Receiver is shutdown", thread::current().id()); | ||||||
|                 }; |                 }; | ||||||
|  |  | ||||||
|                 rt.block_on(f) |                 trace!("({:?}) start runtime::block_on", thread::current().id()); | ||||||
|  |                 rt.block_on(f); | ||||||
|  |                 trace!("({:?}) end runtime::block_on", thread::current().id()); | ||||||
|  |                 drop(rt); | ||||||
|  |                 trace!("({:?}) finished", thread::current().id()); | ||||||
|             }) |             }) | ||||||
|             .map_err(crate::error::builder)?; |             .map_err(crate::error::builder)?; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -40,9 +40,10 @@ where | |||||||
|                 return Err(Waited::TimedOut(crate::error::TimedOut)); |                 return Err(Waited::TimedOut(crate::error::TimedOut)); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             log::trace!("park timeout {:?}", deadline - now); |             log::trace!("({:?}) park timeout {:?}", thread::current().id(), deadline - now); | ||||||
|             thread::park_timeout(deadline - now); |             thread::park_timeout(deadline - now); | ||||||
|         } else { |         } else { | ||||||
|  |             log::trace!("({:?}) park without timeout", thread::current().id()); | ||||||
|             thread::park(); |             thread::park(); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user