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
Timeout during query merge #168
Comments
This query is also throwing the same error, but every single time:
Same for
|
This is not an issue with the driver: the driver is correctly handling the 503 error returned by the database. The fact that it is timing out is an issue with the database, though. This is possibly related to this forums topic: https://forums.fauna.com/t/fqlv10-comparison-of-objects-never-completes/3652 Where the issue is the DB hanging on a comparison between non-comparable types. In your case, you're not providing a boolean value to fql`Message.where(.role != null)` |
Closing this, but will make a note to follow up here regarding the DB issue. |
We are still investigating the issue with The
Note that the default query-timeout is 5 seconds. In this case, it is most likely that Fauna simply spent more than 5 seconds scanning, looking for a document with a role field, and found none. If it had found the one document, you would be more likely to get a 400 error with a message like error: expected type: Boolean, received String or similar. |
Thanks for all the info, @ptpaterson ! Config: const client = new Client({
query_timeout_ms: 60_000,
http2_session_idle_ms: 60_000,
})
await client.query(fql`Message.all().where(m => m.service == ${service}).paginate(9999)`) Error: {
query: {
fql: [
'Message.all().where(m => m.service == ',
[Object],
').paginate(9999)'
]
},
arguments: undefined
}
/node_modules/.pnpm/fauna@0.9.0/node_modules/fauna/src/http-client/node-http2-client.ts:94
throw new NetworkError(
^
NetworkError: The network connection encountered a problem.
at _NodeHTTP2Client.request (/node_modules/.pnpm/fauna@0.9.0/node_modules/fauna/src/http-client/node-http2-client.ts:94:17)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async _Client.query_fn (/node_modules/.pnpm/fauna@0.9.0/node_modules/fauna/src/client.ts:385:9)
at async fetchMessages (file:///data-science/fetch-data.ts:15:18)
at async processService (file:///data-science/fetch-data.ts:27:18)
at async file:///data-science/fetch-data.ts:68:1 {
[cause]: Error [ERR_HTTP2_STREAM_ERROR]: Stream closed with error code NGHTTP2_INTERNAL_ERROR
at new NodeError (node:internal/errors:377:5)
at ClientHttp2Stream._destroy (node:internal/http2/core:2339:13)
at _destroy (node:internal/streams/destroy:109:10)
at ClientHttp2Stream.destroy (node:internal/streams/destroy:71:5)
at Http2Stream.onStreamClose (node:internal/http2/core:549:12) {
code: 'ERR_HTTP2_STREAM_ERROR'
}
} |
Reopening as @zvictor has asked another question. |
@zvictor that idle timeout is quite aggressive. That will attempt to hold an open, but unused http2 session to Fauna for 60s. I would be surprised if Fauna is willing to do the same on the http2 session. I am speculating that that may be the cause of the NetworkError; as Fauna may simply be hanging up on you. Can you try this without setting that timeout (and thus using the driver's default of 5s)? There's some basis in the Node docs for this theory as well: https://nodejs.org/api/http2.html#destruction |
I won't be able to work on the project I was working on for quite a while. Once I do, I can check it out, but not before that. I am sorry. Feel free to close the issue once again. |
Please reopen if you want more help with this. |
While debugging a non related component of my code I wanted to temporarily reduce the load on Fauna. Thus, I added a
.take(1)
to my query before a.paginate
call. By doing so, I got aTimeout during query merge
.I could reproduce the error both in fauna
0.8.0
as in0.9.0
.Here is the broken query:
If I change it to
take(10)
, it works. If I remove.take
, it also works.The text was updated successfully, but these errors were encountered: