MCPcopy Create free account
hub / github.com/apache/datafusion / runtime_shutdown

Function runtime_shutdown

datafusion/common-runtime/src/common.rs:123–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

121
122 #[tokio::test]
123 async fn runtime_shutdown() {
124 let rt = Runtime::new().unwrap();
125 #[expect(clippy::async_yields_async)]
126 let task = rt
127 .spawn(async {
128 SpawnedTask::spawn(async {
129 let fut: Pending<()> = pending();
130 fut.await;
131 unreachable!("should never return");
132 })
133 })
134 .await
135 .unwrap();
136
137 // caller shutdown their DF runtime (e.g. timeout, error in caller, etc)
138 rt.shutdown_background();
139
140 // race condition
141 // poll occurs during shutdown (buffered stream poll calls, etc)
142 assert!(matches!(
143 task.join_unwind().await,
144 Err(e) if e.is_cancelled()
145 ));
146 }
147
148 #[tokio::test]
149 #[should_panic(expected = "foo")]

Callers

nothing calls this directly

Calls 2

newFunction · 0.85
spawnMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…