prisma: .transaction([]) fails with Request Timeout Error
Bug description
Using the new .transaction([]), I am seeing this on the client (JavaScript):
{ Error: Request Timeout Error
at PrismaClientFetcher._request (/app/node_modules/@prisma/client/runtime/index.js:1:213208) code: 'UND_ERR_REQUEST_TIMEOUT', meta: undefined }
How to reproduce
Add multiple child records to an existing parent record.
const requests = [];
// loop that creates around 30 different requests, each with perhaps 500 to 1000 and puts them in the array like this:
requests.push(prisma.{entity}.update({
where: { id: {id that exists}},
data: {
{related entity name}: {
create: [
{ between 500 and 1000 individual entities },
]
},
})
await prisma.transaction(requests);
Expected behavior
Should complete without throwing the exception.
Prisma information
Sorry, I can not share this information. But, I can tell you it’s just doing basic inserts.
Environment & setup
- OS: macOS 10.15.5
- Database: MySQL 5.7.x
- Prisma version: 2.2.0
- Node.js version: v14.5.0
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 19 (7 by maintainers)
Commits related to this issue
- fix(client): remove undici timeout. Closes #2957 — committed to prisma/prisma by timsuchanek 4 years ago
- fix(client): remove undici timeout. Closes #2957 — committed to prisma/prisma by timsuchanek 4 years ago
- fix(client): remove undici timeout. Closes #2957 — committed to prisma/prisma by timsuchanek 4 years ago
- fix(client): remove undici timeout. Closes #2957 — committed to prisma/prisma by timsuchanek 4 years ago
- fix(client): remove undici timeout. Closes #2957 — committed to prisma/prisma by timsuchanek 4 years ago
FYI: 2.5.0 has been released.
@janpio I’ve opened an issue #3892
Please open a new issue with this error @durdenx and we are happy to look into that.
Great. Thanks @Jolg42! Things will be in development on my end too for at least the next week, so it’ll be nice to at least be able to get stuff tested while I wait for the official release.
Thanks again!
@jshimko If it merged that means it will be available in the nightly build, just use that since it will most likely be included in 2.5.0. Maybe @timsuchanek can create a patch version for this fix since it is pretty annoying though.