bkietz commented on a change in pull request #11286:
URL: https://github.com/apache/arrow/pull/11286#discussion_r728279541



##########
File path: python/pyarrow/tests/test_dataset.py
##########
@@ -3389,6 +3392,73 @@ def test_write_dataset_with_scanner(tempdir):
                     ) == table.drop(["a"]).to_pydict()
 
 
+def test_write_dataset_with_backpressure(tempdir):
+    consumer_gate = threading.Semaphore(0)
+
+    class GatingFs(ProxyHandler):
+        def open_output_stream(self, path, metadata):
+            consumer_gate.acquire(1)
+            return self._fs.open_output_stream(path, metadata=metadata)

Review comment:
       IIUC this FileSystem just hangs indefinitely when opening an output 
stream so that backpressure builds up. Please add a comment describing the 
intent, and maybe replace the Semaphore with `test_complete = threading.Event()`
   ```suggestion
               # hang until the test completes to cause artificial write 
backpressure
               test_complete.wait()
               return devnull
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to