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

Add a wrapper to convert file streams to multipart #17327

Closed
wants to merge 5 commits into from

Conversation

H-Shay
Copy link
Contributor

@H-Shay H-Shay commented Jun 19, 2024

based on https://github.com/element-hq/synapse/compare/erikj/fixup_multipart

#17172 changed the storage provider fetch API, which caused breakage in 3rd party storage providers.
This PR fixes that by removing the change to the api, and adding a multipart file consumer which consumes a file stream and converts it to mulipart before streaming that out to the requester.

@H-Shay H-Shay requested a review from a team as a code owner June 19, 2024 04:58
self.producer = producer
self.streaming = streaming

self.wrapped_consumer.registerProducer(self, streaming)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self.wrapped_consumer.registerProducer(self, streaming)
self.wrapped_consumer.registerProducer(self, True)

Would be good to know why you changed it to this. My understanding is that MultipartFileConsumer operates as a IPushProducer irrespective of what producer is, and so we should we always set the streaming flag in registerProducer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So this was a change that I made after I ran an integration test and found that the file streaming response was hanging indefinitely causing the original request to time out - changing it to this worked and so I didn't think much about it, but it sounds like maybe I need to investigate further...

@H-Shay H-Shay closed this Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants