arbitrary stuck queries
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 8.7k
- Forks
- 374
- Avg merge
- 11d 16h
- Merged PRs (30d)
- 1
Description
We have an issue, where the sql client just does not respond. In other words, the promise does not resolve nor reject.
The application has peaks with lots of concurrent requests. The issue though also happens when there is not much load. It just arbitrary does not respond. When i restart the application, everything works fine again.
The client configuration:
return postgres(options.connectionString, {
idle_timeout: 0,
connect_timeout: 30,
max: 50,
});
I have a feeling that it happens after the service ran for some time already.
I also had a feeling that it often occurs with sql.begin(...), but i have also seen it once at a single sql`SELECT * FROM x WHERE id = ${id}`
Not sure where to start looking at here, since we are currently not able to reproduce it. Does anyone have any ideas why this could happen? I would also be happy to contribute to the project if we are able to find the issue here.
UPDATE
Here is the chart of one occurrence of the postgres DB, the needle is placed when the incident happened.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the client configuration and compare the hanging paths reported for sql.begin(...) and the tagged SELECT query, including behavior under concurrent requests and after long runtimes. Reproduce or narrow down the unresolved promise condition, then document the cause and a verified resolution for both transaction and single-query cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs, postgresql
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100