This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix 500 error on /messages
when we accumulate more than 5 backward extremities
#11027
Merged
MadLittleMods
merged 9 commits into
develop
from
madlittlemods/fix-npe-keyerror-when-more-than-5-extremeties
Oct 14, 2021
Merged
Fix 500 error on /messages
when we accumulate more than 5 backward extremities
#11027
MadLittleMods
merged 9 commits into
develop
from
madlittlemods/fix-npe-keyerror-when-more-than-5-extremeties
Oct 14, 2021
Commits on Oct 8, 2021
-
Fix 500 error on /messages when we accumulate more than 5 backwards e…
…xtremeties Found while working on the Gitter backfill script and noticed it only happened after we sent 7 batches, https://gitlab.com/gitterHQ/webapp/-/merge_requests/2229#note_665906390 When there are more than 5 backwards extremities for a given depth, backfill will throw an error because we sliced the extremity list to 5 but then try to iterate over the full list. This causes us to look for state that we never fetched and we get a KeyError. When calling `/messages`: ``` Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/synapse/http/server.py", line 258, in _async_render_wrapper callback_return = await self._async_render(request) File "/usr/local/lib/python3.8/site-packages/synapse/http/server.py", line 446, in _async_render callback_return = await raw_callback_return File "/usr/local/lib/python3.8/site-packages/synapse/rest/client/room.py", line 580, in on_GET msgs = await self.pagination_handler.get_messages( File "/usr/local/lib/python3.8/site-packages/synapse/handlers/pagination.py", line 396, in get_messages await self.hs.get_federation_handler().maybe_backfill( File "/usr/local/lib/python3.8/site-packages/synapse/handlers/federation.py", line 133, in maybe_backfill return await self._maybe_backfill_inner(room_id, current_depth, limit) File "/usr/local/lib/python3.8/site-packages/synapse/handlers/federation.py", line 386, in _maybe_backfill_inner likely_extremeties_domains = get_domains_from_state(states[e_id]) KeyError: '$zpFflMEBtZdgcMQWTakaVItTLMjLFdKcRWUPHbbSZJl' ```
Configuration menu - View commit details
-
Copy full SHA for 4cb7d09 - Browse repository at this point
Copy the full SHA 4cb7d09View commit details -
Configuration menu - View commit details
-
Copy full SHA for 94b9efb - Browse repository at this point
Copy the full SHA 94b9efbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7364b81 - Browse repository at this point
Copy the full SHA 7364b81View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ceaf25 - Browse repository at this point
Copy the full SHA 0ceaf25View commit details -
Configuration menu - View commit details
-
Copy full SHA for 694ca81 - Browse repository at this point
Copy the full SHA 694ca81View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4e75ea3 - Browse repository at this point
Copy the full SHA 4e75ea3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 85748bd - Browse repository at this point
Copy the full SHA 85748bdView commit details
Commits on Oct 14, 2021
-
Merge branch 'develop' into madlittlemods/fix-npe-keyerror-when-more-…
…than-5-extremeties
Configuration menu - View commit details
-
Copy full SHA for 6a119a4 - Browse repository at this point
Copy the full SHA 6a119a4View commit details -
Revert code change and opt to change type hint
See #11027 (comment) Dict[str, Any] will behave as an Iterable[str] when iterating on it
Configuration menu - View commit details
-
Copy full SHA for 391bc73 - Browse repository at this point
Copy the full SHA 391bc73View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.