-
Notifications
You must be signed in to change notification settings - Fork 503
Reintroduce #17291. #17338
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
Merged
Merged
Reintroduce #17291. #17338
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Do not block event sending/receiving while calulating large event auth chains. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -148,6 +148,10 @@ def __init__( | |
| 500000, "_event_auth_cache", size_callback=len | ||
| ) | ||
|
|
||
| # Flag used by unit tests to disable fallback when there is no chain cover | ||
| # index. | ||
| self.tests_allow_no_chain_cover_index = True | ||
|
|
||
| self._clock.looping_call(self._get_stats_for_federation_staging, 30 * 1000) | ||
|
|
||
| if isinstance(self.database_engine, PostgresEngine): | ||
|
|
@@ -220,8 +224,10 @@ async def get_auth_chain_ids( | |
| ) | ||
| except _NoChainCoverIndex: | ||
| # For whatever reason we don't actually have a chain cover index | ||
| # for the events in question, so we fall back to the old method. | ||
| pass | ||
| # for the events in question, so we fall back to the old method | ||
| # (except in tests) | ||
| if not self.tests_allow_no_chain_cover_index: | ||
| raise | ||
|
|
||
| return await self.db_pool.runInteraction( | ||
| "get_auth_chain_ids", | ||
|
|
@@ -271,7 +277,7 @@ def _get_auth_chain_ids_using_cover_index_txn( | |
| if events_missing_chain_info: | ||
| # This can happen due to e.g. downgrade/upgrade of the server. We | ||
| # raise an exception and fall back to the previous algorithm. | ||
| logger.info( | ||
| logger.error( | ||
|
Member
Author
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. We really shouldn't be seeing these anymore I don't think, except while old servers are upgrading (with the background update running) |
||
| "Unexpectedly found that events don't have chain IDs in room %s: %s", | ||
| room_id, | ||
| events_missing_chain_info, | ||
|
|
@@ -482,8 +488,10 @@ async def get_auth_chain_difference( | |
| ) | ||
| except _NoChainCoverIndex: | ||
| # For whatever reason we don't actually have a chain cover index | ||
| # for the events in question, so we fall back to the old method. | ||
| pass | ||
| # for the events in question, so we fall back to the old method | ||
| # (except in tests) | ||
| if not self.tests_allow_no_chain_cover_index: | ||
| raise | ||
|
|
||
| return await self.db_pool.runInteraction( | ||
| "get_auth_chain_difference", | ||
|
|
@@ -710,7 +718,7 @@ def _fixup_auth_chain_difference_sets( | |
| if events_missing_chain_info - event_to_auth_ids.keys(): | ||
| # Uh oh, we somehow haven't correctly done the chain cover index, | ||
| # bail and fall back to the old method. | ||
| logger.info( | ||
| logger.error( | ||
| "Unexpectedly found that events don't have chain IDs in room %s: %s", | ||
| room_id, | ||
| events_missing_chain_info - event_to_auth_ids.keys(), | ||
|
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.