Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Internal Server Error when doing "intensive" concurrent mutation #3229

Closed
mjamelot opened this issue Oct 1, 2018 · 6 comments
Closed

Internal Server Error when doing "intensive" concurrent mutation #3229

mjamelot opened this issue Oct 1, 2018 · 6 comments

Comments

@mjamelot
Copy link

mjamelot commented Oct 1, 2018

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.

@marktani marktani added the bug/1-repro-available A reproduction exists and needs to be confirmed. label Oct 8, 2018
@mjamelot
Copy link
Author

Do you have fix for this issue?
Perhaps have you an parameter to check the prisma occupancy ?

@mjamelot
Copy link
Author

@marktani
Do you have fix for this issue?
Perhaps have you an parameter to check the prisma occupancy ?

@pantharshit00 pantharshit00 added the bug/1-repro-available A reproduction exists and needs to be confirmed. label Jan 9, 2019
@mjamelot
Copy link
Author

mjamelot commented Apr 2, 2019

I upgrade the prisma version version 1.15.3 to 1.27.3

@pantharshit00
Copy link
Contributor

@mjamelot

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

@pantharshit00 pantharshit00 added kind/question and removed bug/1-repro-available A reproduction exists and needs to be confirmed. labels Apr 4, 2019
@nsignes-harmonicinc
Copy link

Hi @pantharshit00 !
Can this limit be configured ?
Is there any other "hard limit" on prisma queue ? (size of individual query, number of elements in a nested operation, etc... ?)

Thanks !

@pantharshit00
Copy link
Contributor

@nsignes

We have just released 1.32.1 in which you can configure this(https://github.com/prisma/prisma/releases/tag/1.32.1)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants