Skip to content
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

Fix gRPC response stream [Replace AsyncPipe with BoundedPriorityQueue] #261

Open
prachi30 opened this issue Jun 21, 2021 · 1 comment
Open
Labels
bug Something isn't working M-grpc This issue is related to the gRPC module P1 Priority 1
Milestone

Comments

@prachi30
Copy link
Contributor

prachi30 commented Jun 21, 2021

Currently send method for gRPC response stream does not await while adding messages to async pipe and that is causing issues in case when a new message is added to response stream while the last one is still pending.

Here's the stack trace:
fields":{"stack":["Error: there is already a pending send call\n at /usr/src/node_modules/@walmartlabs/cookie-cutter-core/dist/utils/AsyncPipe.js:29:24\n at new Promise ()\n at AsyncPipe.send (/usr/src/node_modules/@walmartlabs/cookie-cutter-core/dist/utils/AsyncPipe.js:24:16)\n at GrpcResponseStream.send (/usr/src/node_modules/@walmartlabs/cookie-cutter-grpc/dist/internal/GrpcResponseStream.js:39:26)\n

@plameniv plameniv added bug Something isn't working M-grpc This issue is related to the gRPC module labels Jul 27, 2021
@plameniv plameniv added this to the 1.4 milestone Jul 27, 2021
@plameniv plameniv added the P2 Priority 2 label Jul 27, 2021
@plameniv plameniv changed the title Fix gRPC response stream Fix gRPC response stream [Replace AsyncPipe with BoundedPriorityQueue] Jul 27, 2021
@plameniv
Copy link
Collaborator

After some investigation, we could not determine why the above error would occur in the service with its current settings. The adding an await as suggested did not solve the issue in testing.

As a potential solution, we can replace the AsyncPipe with a BoundedPriorityQueue.

@plameniv plameniv added P1 Priority 1 and removed P2 Priority 2 labels Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working M-grpc This issue is related to the gRPC module P1 Priority 1
Development

No branches or pull requests

2 participants