-
Notifications
You must be signed in to change notification settings - Fork 38
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
RangeError in server_messages.dart #387
Comments
@ryanheise thanks for reporting this, it is worth to investigate what we can improve here. Why postgresql version are you using? Any special extension or data type that could have been part of the result? |
Here is the output from within psql:
Although I did not log the specific SQL query, there are queries based on the pgvector extension, both to insert/update embeddings and also to query embeddings. In each of these cases, I am passing the vectors in their string/text representation (I wasn't able to get it to work directly as an array). |
I actually do have the idle query saved from my psql session. I can't give the entire schema, but mytable has columns with the following types:
And the idle query was long these lines:
|
@ryanheise these were helpful, thank you! I did not explore the actual parsing error yet, but I have found a missing part where the protocol-level bug was not bubbling up, and I wrote a test for it #388. I've published a new version, hopefully it will expose the actual protocol-level bug with better details. |
I believe I may have encountered the problematic query again, and with the newer version of this package (3.4.3), I captured this error message:
Unfortunately, I had forgotten to print the stack trace, although it appears from the source that this would have an unambiguous stack trace. Interestingly, I did learn that the query matched a large number of rows (around 5000 with close to 50 columns) on the occasion when it produced this error, so maybe that is something. The same query does work correctly in psql. |
@ryanheise: please upgrade the version, as 3.4.5 should have already fixed it. |
I just noticed this in my logs today:
After this happens, the connection is essentially hung on the query forever. If I go into psql from the console and select from
pg_stat_activity
I can see all the queries are in theidle
state and nothing is blocking them. This is not recoverable unless I manually kill the idle processes withpg_terminate_backend
.I can only see this exception by listening for zone errors so I can't directly catch it at the point in my code where the exception was triggered. I guess the exception should not happen in the first place, but if it does happen, it would be nice if server_messages.dart handled the exception and forwarded it back to the original call site.
I believe there might also be some other scenarios where the connection can hang, and the only way is to kill the idle processes manually. However, this is the only time when I've been given an actual exception to report. Since those other cases are still unknown, I am hoping there is an explanation in general for why this package might be hanging on idle processes where nothing is blocking them (I'm assuming it's something like the processes are remaining in the idle state because this package hasn't yet closed the cursors or something). As yet, I haven't worked out a way to reproduce it other than letting the application run for long enough until by chance the DB connection hangs. The stacktrace above, however, has only ever happened once, so I'm not sure if I'm likely to ever see it again.
This exception occurred with release 3.4.2.
The text was updated successfully, but these errors were encountered: