()
| 1971 | raised_proper_exception = threading.Event() |
| 1972 | |
| 1973 | def block_read(): |
| 1974 | reader.read_chunk() |
| 1975 | read_first_message.set() |
| 1976 | stream_canceled.wait(timeout=5) |
| 1977 | try: |
| 1978 | reader.read_chunk() |
| 1979 | except flight.FlightCancelledError: |
| 1980 | with result_lock: |
| 1981 | raised_proper_exception.set() |
| 1982 | |
| 1983 | thread = threading.Thread(target=block_read, daemon=True) |
| 1984 | thread.start() |