Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow queries returning "RST_STREAM with error code 2" #19

Open
aidanalphafund opened this issue May 27, 2023 · 2 comments
Open

Slow queries returning "RST_STREAM with error code 2" #19

aidanalphafund opened this issue May 27, 2023 · 2 comments

Comments

@aidanalphafund
Copy link

When running a slow query (30+ seconds), I'm getting the following error:

pyarrow._flight.FlightInternalError: Flight returned internal error, with message: Received RST_STREAM with error code 2. gRPC client debug context: UNKNOWN:Error received from peer ipv4:54.174.236.48:443 {created_time:"2023-05-26T17:31:53.650218-06:00", grpc_status:13, grpc_message:"Received RST_STREAM with error code 2"}. Client context: OK

I'm storing stock market information in my database, and running this query:

        SELECT 
        DATE_BIN(INTERVAL '5 minutes', time) as date,
        symbol,
        selector_first(open, time)['value'] as open,
        selector_last(close, time)['value'] as close,
        selector_max(high, time)['value'] as high,
        selector_min(low, time)['value'] as low,
        sum(volume) as volume
        from minute_bar
        GROUP BY symbol, date
        ORDER BY symbol, date

When running using the influxdb data explorer, this query takes around 2 minutes to run. I consistently get this same error when using the flightsql-dbapi python library to run the query

@aidanalphafund
Copy link
Author

I just realized this error might be related to the size of the returned dataset, not the time it takes to stream the response body.

@aidanalphafund
Copy link
Author

Just following up - I have been able to verify that the error occurs on slow queries only returning a single row. It doesn't appear to be a problem with the number of rows returned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant