You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We created a test script written in go that iterates for a list of test queries and uses go routines to make requests to the router which is running on the same machine. For some of the those requests this line raise the following graphQL error:
{"errors":[{"message":"error parsing request body: invalid character '{' after top-level value"}]}
when I look at the httpOperation.body I am seeing two post bodies inside eg.
However, when I check what request is being received there is only 1 query in the body. It seems that the ReadBody function here is appending the new query to the buffer where the old query is already in. I am not sure if I need to start the router somehow differently or if I missed something else? When I do the requests sequentially I do not encounter this issue.
Steps to Reproduce
Create a script which uses go routines to target the router. I can pretty consistently reproduce it with 100 queries in total. The router fails on different queries so it seems there is some kind of race condition involved.
Expected Result
Have only the current post body in the buffer
Actual Result
The previous post body is still present in the buffer and the request fails.
WunderGraph commits fully to Open Source and we want to make sure that we can help you as fast as possible.
The roadmap is driven by our customers and we have to prioritize issues that are important to them.
You can influence the priority by becoming a customer. Please contact us here.
Component(s)
router
Component version
v0.0.0-20240927172855-3e390cd5cf6c
wgc version
None
controlplane version
None
router version
v0.0.0-20240927172855-3e390cd5cf6c
What happened?
Description
We created a test script written in go that iterates for a list of test queries and uses go routines to make requests to the router which is running on the same machine. For some of the those requests this line raise the following graphQL error:
when I look at the
httpOperation.body
I am seeing two post bodies inside eg."{\"query\": \"query {\\n rateLimit {\\n limit\\n remaining\\n resetAt\\n }\\n}\"}{\"query\": \"query GetRepositoryMergeQueue {\\n repository(owner: \\\"<REDACTED>\\\", name: \\\"<REDACTED>\\\") {\\n mergeQueue {\\n id\\n }\\n }\\n}\"}"
However, when I check what request is being received there is only 1 query in the body. It seems that the ReadBody function here is appending the new query to the buffer where the old query is already in. I am not sure if I need to start the router somehow differently or if I missed something else? When I do the requests sequentially I do not encounter this issue.
Steps to Reproduce
Create a script which uses go routines to target the router. I can pretty consistently reproduce it with 100 queries in total. The router fails on different queries so it seems there is some kind of race condition involved.
Expected Result
Have only the current post body in the buffer
Actual Result
The previous post body is still present in the buffer and the request fails.
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Package Manager: pnpm, npm, yarn, etc
Compiler(if manually compiled): (e.g., "go 14.2")
Router configuration
Router execution config
Log output
Additional context
We are only looking at query plans so all the requests are executed with these headers
The text was updated successfully, but these errors were encountered: