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

Support FileRegions for AWS Lambda HTTP and Azure Functions HTTP #9714

Closed
wants to merge 1 commit into from

Conversation

patriot1burke
Copy link
Contributor

quarkus-amazon-lambda-http and quarkus-azure-functions-http did not support FileRegion and things like swagger and other static endpoints were not working.

@stuartwdouglas One issue that popped up with this solution was that there was a race condition. The FileRegion was being closed before the AWS/Azure layer was able to process the message. Ended up having to do some ugly thread synchronization. Not sure if this will be a performance hit or not.

Copy link
Member

@stuartwdouglas stuartwdouglas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you just want to allocate buffers of size io.netty.channel.DefaultFileRegion#count and fully buffer the whole thing.

FileRegion file = (FileRegion) msg;
if (file.count() > 0) {
if (baos == null)
baos = createByteStream();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will truncate files if the length is larger than the 1000 byte buffer.

@gsmet gsmet added the triage/invalid This doesn't seem right label Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

swagger-ui endpoint not accessible in AWS Lambda
3 participants