-
Notifications
You must be signed in to change notification settings - Fork 401
Move reading of multipart response into try
body
#19062
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix a bug introduced in 1.111.0 where failed attempts to download authenticated remote media would not be handled correctly. |
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1719,6 +1719,7 @@ async def federation_get_file( | |||||||||||
response, output_stream, boundary, expected_size + 1 | ||||||||||||
) | ||||||||||||
deferred.addTimeout(self.default_timeout_seconds, self.reactor) | ||||||||||||
multipart_response = await make_deferred_yieldable(deferred) | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be inside the Maybe. We do it in synapse/synapse/http/matrixfederationclient.py Lines 1578 to 1582 in da6c0ca
And although this isn't explained anywhere, I guess the point of |
||||||||||||
except BodyExceededMaxSize: | ||||||||||||
msg = "Requested file is too large > %r bytes" % (expected_size,) | ||||||||||||
logger.warning( | ||||||||||||
|
@@ -1755,7 +1756,6 @@ async def federation_get_file( | |||||||||||
) | ||||||||||||
raise | ||||||||||||
|
||||||||||||
multipart_response = await make_deferred_yieldable(deferred) | ||||||||||||
if not multipart_response.url: | ||||||||||||
assert multipart_response.length is not None | ||||||||||||
length = multipart_response.length | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have tests for this kind of timeout? (just wondering)
It looks like this was previously functional and the only problem was the unexpected logs/error handling so an high-level integration/end-to-end test wouldn't have really prevented this.
It looks like we already have other tests in
tests/http/test_matrixfederationclient.py
that ensure we raise aRequestSendFailed
in certain scenarios. We could add one of those 🤷