-
Notifications
You must be signed in to change notification settings - Fork 859
Internal Server Error when doing "intensive" concurrent mutation #3229
Comments
Do you have fix for this issue? |
@marktani |
I upgrade the prisma version version 1.15.3 to 1.27.3 |
Prisma has an internal queue of 1000 ops, you are doing 4000 ops that is why it is breaking. Can you please batch then using something like https://github.com/sindresorhus/p-map |
Hi @pantharshit00 ! Thanks ! |
@nsignes We have just released 1.32.1 in which you can configure this(https://github.com/prisma/prisma/releases/tag/1.32.1) |
Describe the bug
Internal Server Error when doing "intensive" concurrent mutation
error :{"message":"Whoops. Looks like an internal server error. Search your server logs for request ID: local:api:cjmqfm2isx1jh093916ecehp3","path":["item1"],"locations":[{"line":2,"column":3}],"requestId":"local:api:cjmqfm2isx1jh093916ecehp3"}],"status":200},"request":{"query":"mutation {\n item1: createItem(data: {\n name:"UsersIds 1887"\n label:"myLabel" \n })\n {\n id\n }\n}"
To Reproduce
Steps to reproduce the behavior:
MutationIntensive
Some results could be found in results.log for various environment (prisma version 1.27.3)
Test Performance (internal Server Error when doing "intensive" concurrent mutation)
Valid test Creation of 4000 Item objet synchronously, peuso code:
for (var i = 0; i < userIdList.length; i++) { await mutation(userIdList[i],false) }
Invalid test Creation of 3084 Item objet instead of 4000 concurrently, peuso code:
await Promise.all(userIdList.map(userId => mutation(userId,false)));
To reproduce:
Clone the repository:
git clone https://github.com/mjamelot/MutationIntensive.git
cd MutationIntensive/
npm install
Start the server
npm-run prisma deploy
get prisma token and copy in the index.js
npm-run prisma token
run test
node index.js
result of test
Test1
create 4000 synchronous objet OK :
delete all synchronous objet count{"deleteManyItems":{"count":4000}}
test2
create 3764 instead of 4000 asynchronous objet KO :
delete all aynchronous objet count{"deleteManyItems":{"count":3764}}
observe trace:
error mutation prisma async{"response":{"data":null,"errors":[{"message":"Whoops. Looks like an internal server error. Search your server logs for request ID: local:api:cjmres0t4xgdv0939a3m94ctd","path":["item1"],"locations":[{"line":2,"column":3}],"requestId":"local:api:cjmres0t4xgdv0939a3m94ctd"}],"status":200},"request":{"query":"mutation {\n item1: createItem(data: {\n name:"UsersIds 1622"\n label:"myLabel" \n })\n {\n id\n }\n}"}}
Expected behavior
Screenshots
Versions (please complete the following information):
OS:
centos-release-7-4.1708.el7.centos.x86_64
Linux fdcd67765900 3.10.0-514.21.2.el7.x86_64 #1 SMP Tue Jun 20 12:24:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
prisma CLI, Prisma Server, etc.:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: