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
Today I used patch-package to patch serverless-http@3.2.0 for the project I'm working on.
Issue
I'm using serverless-http with express, and @bufbuild/connect-express to support a gRPC-compatible HTTP api on AWS Lambda and API Gateway. It may not be a super common use case, but we liked the idea of a lightweight backend; and also enjoy the type benefits of leveraging gRPC protocol syntax.
We noticed that copying the same code that runs just fine on a traditional express server with this gRPC adapter library was executing code successfully; however the response was never sent. The write method buf connect uses should actually return a boolean indicating whether the function should wait for a drain event or not, but the custom write method serverless-http defines doesn't return anything; but also doesn't provide a drain event, and so this leads to the hang.
Solution
Simply having the assignSocket method in the response.js file return a boolean value solved this issue for us. If this interferes with any other use case behavior, any assistance in resolving this issue in the preferred way would be very helpful. Thank you in advance!
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
serverless-http@3.2.0
for the project I'm working on.Issue
I'm using
serverless-http
withexpress
, and@bufbuild/connect-express
to support a gRPC-compatible HTTP api on AWS Lambda and API Gateway. It may not be a super common use case, but we liked the idea of a lightweight backend; and also enjoy the type benefits of leveraging gRPC protocol syntax.We noticed that copying the same code that runs just fine on a traditional
express
server with this gRPC adapter library was executing code successfully; however the response was never sent. The write method buf connect uses should actually return a boolean indicating whether the function should wait for a drain event or not, but the custom write methodserverless-http
defines doesn't return anything; but also doesn't provide a drain event, and so this leads to the hang.Solution
Simply having the
assignSocket
method in theresponse.js
file return a boolean value solved this issue for us. If this interferes with any other use case behavior, any assistance in resolving this issue in the preferred way would be very helpful. Thank you in advance!This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: