-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Parallel execution with Promise.all causes P2024 error in version 5.8.0 due to connection limit #22610
Comments
I'm generally getting a significantly higher number of connection pool timeout errors in 5.8.0 than I was in 5.7.1. I needed to revert back to 5.7.1 for now |
I don't think 5.8.0 really changed anything that could have impact on this. Is this reproducible for you? |
In my case I wasn't necessarily using a Promise.all whenever the error was thrown, but it was always the result of a series of |
This example is not code that will actually be used in production. Of course, there is no need to write code like this to retrieve data from In my use case, the usage was as follows. const postIds: string[] = await getPostIdsFromOtherSource()
const getPostsInPostIdsOnlyAuthorGroupAorB = await Promise.all(postIds.map((postId)=> {
const post = await prisma.post.findUnique({
where: {
id: postId,
OR: [
{ author: { group: 'A Group' } },
{ author: { group: 'B Group' } },
]
}
})
}) Of course, this is not a good idea as it will call a large number of queries. There should be a different logic, but a situation occurred where there was no problem with 5.7.1, but a problem occurred with 5.8.0. As I investigated, I found that it was related to the value of The important thing here is that when The point is
|
Facing this issue too when I made a GraphQL query with nested field resolver. I needed to revert back to 5.7.1 |
Thanks for the reproduction repository https://github.com/fujita-h/issue-prisma-580 @fujita-h I could reproduce the following error against a local database and I could identify So looking at commits on Prisma engines (prisma/prisma-engines@5.8.0-dev.6...5.8.0-dev.7), the only one that looks suspicious would be from: feat(query-engine-wasm): vertical slice (#4466) I'll ask my colleagues who worked on that PR to check it and see what they think. The reproductionWith MySQL (like in your reproduction)
and I also tried PostgreSQL
Full DEBUG logs``` DEBUG=* ts-node index.ts prisma:tryLoadEnv Environment variables loaded from /Users/j42/Repros/issue-prisma-580-pg/.env +0ms prisma:client checkPlatformCaching:postinstall undefined +0ms prisma:client checkPlatformCaching:ciName undefined +0ms prisma:tryLoadEnv Environment variables loaded from /Users/j42/Repros/issue-prisma-580-pg/.env +2ms prisma:client dirname /Users/j42/Repros/issue-prisma-580-pg/node_modules/.prisma/client +0ms prisma:client relativePath ../../../prisma +0ms prisma:client cwd /Users/j42/Repros/issue-prisma-580-pg/prisma +0ms prisma:client clientVersion 5.8.0-dev.7 +0ms prisma:client:libraryEngine internalSetup +0ms prisma:client Prisma Client call: +2ms prisma:client prisma.user.upsert({ where: { id: 1 }, create: { id: 1, email: "user0@example.com" }, update: {} }) +1ms prisma:client Generated request: +0ms prisma:client { "modelName": "User", "action": "upsertOne", "query": { "arguments": { "where": { "id": 1 }, "create": { "id": 1, "email": "user0@example.com" }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: false +3ms prisma:client Prisma Client call: +0ms prisma:client prisma.user.upsert({ where: { id: 2 }, create: { id: 2, email: "user1@example.com" }, update: {} }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "User", "action": "upsertOne", "query": { "arguments": { "where": { "id": 2 }, "create": { "id": 2, "email": "user1@example.com" }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: false +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.user.upsert({ where: { id: 3 }, create: { id: 3, email: "user2@example.com" }, update: {} }) +1ms prisma:client Generated request: +0ms prisma:client { "modelName": "User", "action": "upsertOne", "query": { "arguments": { "where": { "id": 3 }, "create": { "id": 3, "email": "user2@example.com" }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: false +1ms prisma:client Prisma Client call: +0ms prisma:client prisma.user.upsert({ where: { id: 4 }, create: { id: 4, email: "user3@example.com" }, update: {} }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "User", "action": "upsertOne", "query": { "arguments": { "where": { "id": 4 }, "create": { "id": 4, "email": "user3@example.com" }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: false +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.user.upsert({ where: { id: 5 }, create: { id: 5, email: "user4@example.com" }, update: {} }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "User", "action": "upsertOne", "query": { "arguments": { "where": { "id": 5 }, "create": { "id": 5, "email": "user4@example.com" }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: false +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.user.upsert({ where: { id: 6 }, create: { id: 6, email: "user5@example.com" }, update: {} }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "User", "action": "upsertOne", "query": { "arguments": { "where": { "id": 6 }, "create": { "id": 6, "email": "user5@example.com" }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: false +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.user.upsert({ where: { id: 7 }, create: { id: 7, email: "user6@example.com" }, update: {} }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "User", "action": "upsertOne", "query": { "arguments": { "where": { "id": 7 }, "create": { "id": 7, "email": "user6@example.com" }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: false +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.user.upsert({ where: { id: 8 }, create: { id: 8, email: "user7@example.com" }, update: {} }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "User", "action": "upsertOne", "query": { "arguments": { "where": { "id": 8 }, "create": { "id": 8, "email": "user7@example.com" }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: false +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.user.upsert({ where: { id: 9 }, create: { id: 9, email: "user8@example.com" }, update: {} }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "User", "action": "upsertOne", "query": { "arguments": { "where": { "id": 9 }, "create": { "id": 9, "email": "user8@example.com" }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: false +0ms prisma:client Prisma Client call: +1ms prisma:client prisma.user.upsert({ where: { id: 10 }, create: { id: 10, email: "user9@example.com" }, update: {} }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "User", "action": "upsertOne", "query": { "arguments": { "where": { "id": 10 }, "create": { "id": 10, "email": "user9@example.com" }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: false +1ms prisma:client:engines:resolveEnginePath enginePath /Users/j42/Repros/issue-prisma-580-pg/node_modules/.prisma/client/libquery_engine-darwin-arm64.dylib.node +0ms prisma:client:libraryEngine library starting +211ms prisma:client:libraryEngine library already starting, this.libraryStarted: false +0ms prisma:client:libraryEngine library already starting, this.libraryStarted: false +0ms prisma:client:libraryEngine library already starting, this.libraryStarted: false +0ms prisma:client:libraryEngine library already starting, this.libraryStarted: false +0ms prisma:client:libraryEngine library already starting, this.libraryStarted: false +0ms prisma:client:libraryEngine library already starting, this.libraryStarted: false +0ms prisma:client:libraryEngine library already starting, this.libraryStarted: false +0ms prisma:client:libraryEngine library already starting, this.libraryStarted: false +0ms prisma:client:libraryEngine library already starting, this.libraryStarted: false +0ms prisma:client:libraryEngine library started +18ms prisma:client Prisma Client call: +255ms prisma:client prisma.post.upsert({ where: { id: 1 }, create: { id: 1, title: "title-0", authorId: 1 }, update: {} }) +1ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "upsertOne", "query": { "arguments": { "where": { "id": 1 }, "create": { "id": 1, "title": "title-0", "authorId": 1 }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: true +27ms prisma:client Prisma Client call: +0ms prisma:client prisma.post.upsert({ where: { id: 2 }, create: { id: 2, title: "title-1", authorId: 2 }, update: {} }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "upsertOne", "query": { "arguments": { "where": { "id": 2 }, "create": { "id": 2, "title": "title-1", "authorId": 2 }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: true +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.post.upsert({ where: { id: 3 }, create: { id: 3, title: "title-2", authorId: 3 }, update: {} }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "upsertOne", "query": { "arguments": { "where": { "id": 3 }, "create": { "id": 3, "title": "title-2", "authorId": 3 }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: true +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.post.upsert({ where: { id: 4 }, create: { id: 4, title: "title-3", authorId: 4 }, update: {} }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "upsertOne", "query": { "arguments": { "where": { "id": 4 }, "create": { "id": 4, "title": "title-3", "authorId": 4 }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: true +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.post.upsert({ where: { id: 5 }, create: { id: 5, title: "title-4", authorId: 5 }, update: {} }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "upsertOne", "query": { "arguments": { "where": { "id": 5 }, "create": { "id": 5, "title": "title-4", "authorId": 5 }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: true +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.post.upsert({ where: { id: 6 }, create: { id: 6, title: "title-5", authorId: 6 }, update: {} }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "upsertOne", "query": { "arguments": { "where": { "id": 6 }, "create": { "id": 6, "title": "title-5", "authorId": 6 }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: true +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.post.upsert({ where: { id: 7 }, create: { id: 7, title: "title-6", authorId: 7 }, update: {} }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "upsertOne", "query": { "arguments": { "where": { "id": 7 }, "create": { "id": 7, "title": "title-6", "authorId": 7 }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: true +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.post.upsert({ where: { id: 8 }, create: { id: 8, title: "title-7", authorId: 8 }, update: {} }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "upsertOne", "query": { "arguments": { "where": { "id": 8 }, "create": { "id": 8, "title": "title-7", "authorId": 8 }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: true +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.post.upsert({ where: { id: 9 }, create: { id: 9, title: "title-8", authorId: 9 }, update: {} }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "upsertOne", "query": { "arguments": { "where": { "id": 9 }, "create": { "id": 9, "title": "title-8", "authorId": 9 }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: true +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.post.upsert({ where: { id: 10 }, create: { id: 10, title: "title-9", authorId: 10 }, update: {} }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "upsertOne", "query": { "arguments": { "where": { "id": 10 }, "create": { "id": 10, "title": "title-9", "authorId": 10 }, "update": {} }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine sending request, this.libraryStarted: true +0ms prisma:client Prisma Client call: +7ms prisma:client prisma.post.findUnique({ where: { id: 1, OR: [ { author: { id: 1 } } ] } }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "findUnique", "query": { "arguments": { "where": { "id": 1, "OR": [ { "author": { "id": 1 } } ] } }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.post.findUnique({ where: { id: 2, OR: [ { author: { id: 2 } } ] } }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "findUnique", "query": { "arguments": { "where": { "id": 2, "OR": [ { "author": { "id": 2 } } ] } }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.post.findUnique({ where: { id: 3, OR: [ { author: { id: 3 } } ] } }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "findUnique", "query": { "arguments": { "where": { "id": 3, "OR": [ { "author": { "id": 3 } } ] } }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.post.findUnique({ where: { id: 4, OR: [ { author: { id: 4 } } ] } }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "findUnique", "query": { "arguments": { "where": { "id": 4, "OR": [ { "author": { "id": 4 } } ] } }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.post.findUnique({ where: { id: 5, OR: [ { author: { id: 5 } } ] } }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "findUnique", "query": { "arguments": { "where": { "id": 5, "OR": [ { "author": { "id": 5 } } ] } }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.post.findUnique({ where: { id: 6, OR: [ { author: { id: 6 } } ] } }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "findUnique", "query": { "arguments": { "where": { "id": 6, "OR": [ { "author": { "id": 6 } } ] } }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.post.findUnique({ where: { id: 7, OR: [ { author: { id: 7 } } ] } }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "findUnique", "query": { "arguments": { "where": { "id": 7, "OR": [ { "author": { "id": 7 } } ] } }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.post.findUnique({ where: { id: 8, OR: [ { author: { id: 8 } } ] } }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "findUnique", "query": { "arguments": { "where": { "id": 8, "OR": [ { "author": { "id": 8 } } ] } }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.post.findUnique({ where: { id: 9, OR: [ { author: { id: 9 } } ] } }) +0ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "findUnique", "query": { "arguments": { "where": { "id": 9, "OR": [ { "author": { "id": 9 } } ] } }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client Prisma Client call: +0ms prisma:client prisma.post.findUnique({ where: { id: 10, OR: [ { author: { id: 10 } } ] } }) +1ms prisma:client Generated request: +0ms prisma:client { "modelName": "Post", "action": "findUnique", "query": { "arguments": { "where": { "id": 10, "OR": [ { "author": { "id": 10 } } ] } }, "selection": { "$composites": true, "$scalars": true } } } +0ms prisma:client:libraryEngine requestBatch +8ms prisma:client:request_handler PrismaClientKnownRequestError: Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 5) at Pr (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:36:253) at zt.buildQueryError (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:978) at zt.requestBatch (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:409) at async /Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:125:4943 { code: 'P2024', clientVersion: '5.8.0-dev.7', meta: { connection_limit: 5, timeout: 10 } } +0ms prisma:client:request_handler PrismaClientKnownRequestError: Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 5) at Pr (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:36:253) at zt.buildQueryError (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:978) at zt.requestBatch (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:409) at async /Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:125:4943 { code: 'P2024', clientVersion: '5.8.0-dev.7', meta: { connection_limit: 5, timeout: 10 } } +5ms prisma:client:request_handler PrismaClientKnownRequestError: Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 5) at Pr (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:36:253) at zt.buildQueryError (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:978) at zt.requestBatch (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:409) at async /Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:125:4943 { code: 'P2024', clientVersion: '5.8.0-dev.7', meta: { connection_limit: 5, timeout: 10 } } +0ms prisma:client:request_handler PrismaClientKnownRequestError: Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 5) at Pr (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:36:253) at zt.buildQueryError (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:978) at zt.requestBatch (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:409) at async /Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:125:4943 { code: 'P2024', clientVersion: '5.8.0-dev.7', meta: { connection_limit: 5, timeout: 10 } } +1ms prisma:client:request_handler PrismaClientKnownRequestError: Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 5) at Pr (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:36:253) at zt.buildQueryError (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:978) at zt.requestBatch (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:409) at async /Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:125:4943 { code: 'P2024', clientVersion: '5.8.0-dev.7', meta: { connection_limit: 5, timeout: 10 } } +0ms prisma:client:request_handler PrismaClientKnownRequestError: Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 5) at Pr (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:36:253) at zt.buildQueryError (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:978) at zt.requestBatch (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:409) at async /Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:125:4943 { code: 'P2024', clientVersion: '5.8.0-dev.7', meta: { connection_limit: 5, timeout: 10 } } +1ms prisma:client:request_handler PrismaClientKnownRequestError: Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 5) at Pr (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:36:253) at zt.buildQueryError (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:978) at zt.requestBatch (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:409) at async /Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:125:4943 { code: 'P2024', clientVersion: '5.8.0-dev.7', meta: { connection_limit: 5, timeout: 10 } } +1ms prisma:client:request_handler PrismaClientKnownRequestError: Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 5) at Pr (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:36:253) at zt.buildQueryError (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:978) at zt.requestBatch (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:409) at async /Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:125:4943 { code: 'P2024', clientVersion: '5.8.0-dev.7', meta: { connection_limit: 5, timeout: 10 } } +0ms prisma:client:request_handler PrismaClientKnownRequestError: Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 5) at Pr (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:36:253) at zt.buildQueryError (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:978) at zt.requestBatch (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:409) at async /Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:125:4943 { code: 'P2024', clientVersion: '5.8.0-dev.7', meta: { connection_limit: 5, timeout: 10 } } +1ms prisma:client:request_handler PrismaClientKnownRequestError: Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 5) at Pr (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:36:253) at zt.buildQueryError (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:978) at zt.requestBatch (/Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:117:409) at async /Users/j42/Repros/issue-prisma-580-pg/node_modules/@prisma/client/runtime/library.js:125:4943 { code: 'P2024', clientVersion: '5.8.0-dev.7', meta: { connection_limit: 5, timeout: 10 } } +0ms PrismaClientKnownRequestError: Invalid `prisma.post.findUnique()` invocation in /Users/j42/Repros/issue-prisma-580-pg/index.ts:31:2428 // Query which causes the error on Prisma Client 5.8.0
|
Problem: we awaited spawned future immediately, which kind of makes spawn useless, effecctively serializing batch requests instead of executing them in parallel. Affects only the batches that could not be compated into a single query. I struggled to reproduce the error in engine's test suite. I suggest we test it in client instead. Fix prisma/prisma#22610
Update: @SevInf is working on a fix, stay tuned 📻 |
@fujita-h @duongdev @jkepps could you please test it out with Thank you! |
Problem: we awaited spawned future immediately, which kind of makes spawn useless, effecctively serializing batch requests instead of executing them in parallel. Affects only the batches that could not be compated into a single query. I struggled to reproduce the error in engine's test suite. I suggest we test it in client instead. Fix prisma/prisma#22610
@SevInf using the dev snapshot you provided, I confirmed that the problem was resolved in both my product and the reproduction repository. Thank you! |
* qe: Fix timeout errors Problem: we awaited spawned future immediately, which kind of makes spawn useless, effecctively serializing batch requests instead of executing them in parallel. Affects only the batches that could not be compated into a single query. I struggled to reproduce the error in engine's test suite. I suggest we test it in client instead. Fix prisma/prisma#22610 * Fix wasm * Use spawn_local for WASM branch * Address more review comments
* qe: Fix timeout errors Problem: we awaited spawned future immediately, which kind of makes spawn useless, effecctively serializing batch requests instead of executing them in parallel. Affects only the batches that could not be compated into a single query. I struggled to reproduce the error in engine's test suite. I suggest we test it in client instead. Fix prisma/prisma#22610 * Fix wasm * Use spawn_local for WASM branch * Address more review comments
Should fail until engine update makes it into a client.
Thanks everyone, the fix is released in 5.8.1 |
Should fail until engine update makes it into a client.
@SevInf Has this fix not been released yet? |
@liyofx as per my last comment, issue reported here was fixed, fix got confirmed by OP and the fix got released in 5.8.1. Whatever you are experiencing is probably not related to this issue. Please, open a new one and provide a reproduction. |
Bug description
In version 5.8.0, when using
Promise.all
to execute queries in parallel, some queries generate a P2024 error if the number ofconnection_limit
is less than the number of parallel executions.In version 5.7.1, I got the desired results without any errors.
How to reproduce
see https://github.com/fujita-h/issue-prisma-580
Expected behavior
No response
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: