Closed ghost closed 2 years ago
Is it a normal "SELECT" statement or is it an HTTP transport wrapped statement (like .export_to_pandas()
)?
I see how it might be happening to HTTP transport, but it would be very odd for normal statement. Here is the place in code which writes log message you've mentioned, and it is guaranteed to raise an exception afterwards if status == error
: https://github.com/exasol/pyexasol/blob/c9b1f445d1f1424b8cf9aaa7b42945c935fdbb0e/pyexasol/connection.py#L539-L562
actually it is an .export_to_file
statement
Is it OS Windows?
Here is the code which closes pipes in case of exception: https://github.com/exasol/pyexasol/blob/c9b1f445d1f1424b8cf9aaa7b42945c935fdbb0e/pyexasol/http_transport.py#L253-L260
Which should terminate copyfileobj
call in the main thread due to BrokenPipe
: https://github.com/exasol/pyexasol/blob/master/pyexasol/callback.py#L52
Hmm, that's odd.
Does it reproduce for .export_to_pandas()
?
.export_to_pandas
raise the exception correctly.
Oh and the OS is Windows 10
I'll have access to Win10 machine this weekend. I'll try to reproduce and add a workaround.
If you'll have a chance to post a reply, could you also add a Python version? I suspect, something was changed in copyfileobj
implementation for Windows in recent versions.
actually I'm still on Python 3.7 since this is what we use in production at the moment
@xyxz-web , please check the latest version 0.25.0
. This specific problem should no longer occur on Windows.
In theory, it should be possible to remove pipes altogether and use some sort of Python native FIFO binary buffer instead. We may consider implementing it if problems with Windows pipes continue.
Looks good, the following test is now green:
(...)
with pytest.raises(pyexasol.exceptions.ExaQueryError):
conn.export_to_pandas("asdf")
Hello,
when the query runs into an error, instead of raising an exception the script hangs forever. I'm still on Protocol v1 in case it matters. Debug output looks like this, one hour afterwards the script still hangs: