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

Fix sync bug when accepting invites #4956

Merged
merged 4 commits into from Apr 2, 2019

Conversation

2 participants
@richvdh
Copy link
Member

commented Mar 27, 2019

Hopefully this time we really will fix #4422.

We need to make sure that the cache on get_rooms_for_user_with_stream_ordering is invalidated before the SyncHandler is notified for the new events, and we can now do so reliably via the events stream.

Based on #4955.

@richvdh richvdh requested a review from matrix-org/synapse-core Mar 27, 2019

@codecov

This comment has been minimized.

Copy link

commented Mar 27, 2019

Codecov Report

Merging #4956 into develop will increase coverage by 0.03%.
The diff coverage is 87.5%.

@@            Coverage Diff             @@
##           develop   #4956      +/-   ##
==========================================
+ Coverage    60.57%   60.6%   +0.03%     
==========================================
  Files          331     331              
  Lines        34213   34219       +6     
  Branches      5655    5657       +2     
==========================================
+ Hits         20723   20738      +15     
+ Misses       12015   12007       -8     
+ Partials      1475    1474       -1

richvdh added some commits Mar 27, 2019

Fix sync bug when accepting invites
Hopefully this time we really will fix #4422.

We need to make sure that the cache on
`get_rooms_for_user_with_stream_ordering` is invalidated *before* the
SyncHandler is notified for the new events, and we can now do so reliably via
the `events` stream.
Change current_state_delta stream to use min(stream_id)
Fixes a race in the `get_rooms_for_user_with_stream_ordering` cache
invalidation. Hopefully, won't break anything else.

@richvdh richvdh force-pushed the rav/sync_cache_bug_v3 branch from 8660570 to 10027b6 Mar 28, 2019

self.get_rooms_for_user_with_stream_ordering.invalidate(
(data.state_key, ),
)

This comment has been minimized.

Copy link
@erikjohnston

erikjohnston Apr 1, 2019

Member

Can we add an else clause that raises an exception please? Or at least logs loudly.

This comment has been minimized.

Copy link
@richvdh

richvdh Apr 2, 2019

Author Member

done d7e3729

@richvdh richvdh merged commit 297bf25 into develop Apr 2, 2019

24 checks passed

buildkite/synapse Build #742 passed (13 minutes, 5 seconds)
Details
buildkite/synapse/check-sample-config Passed (1 minute, 3 seconds)
Details
buildkite/synapse/isort Passed (23 seconds)
Details
buildkite/synapse/newspaper-newsfile Passed (13 seconds)
Details
buildkite/synapse/packaging Passed (19 seconds)
Details
buildkite/synapse/pep-8 Passed (52 seconds)
Details
buildkite/synapse/pipeline Passed (2 seconds)
Details
buildkite/synapse/python-2-dot-7-slash-postgres-9-dot-4 Passed (11 minutes, 15 seconds)
Details
buildkite/synapse/python-2-dot-7-slash-postgres-9-dot-5 Passed (11 minutes, 38 seconds)
Details
buildkite/synapse/python-2-dot-7-slash-sqlite Passed (6 minutes, 13 seconds)
Details
buildkite/synapse/python-2-dot-7-slash-sqlite-slash-old-deps Passed (7 minutes, 45 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-postgres-9-dot-4 Passed (12 minutes, 4 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-postgres-9-dot-5 Passed (11 minutes, 40 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-sqlite Passed (6 minutes, 41 seconds)
Details
buildkite/synapse/python-3-dot-6-slash-sqlite Passed (6 minutes, 45 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-postgres-11 Passed (11 minutes, 48 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-postgres-9-dot-5 Passed (11 minutes, 46 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-sqlite Passed (6 minutes, 49 seconds)
Details
ci/circleci: sytestpy2merged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy2postgresmerged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3merged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3postgresmerged Your tests passed on CircleCI!
Details
codecov/patch 87.5% of diff hit (target 0%)
Details
codecov/project 60.6% (target 0%)
Details

@richvdh richvdh deleted the rav/sync_cache_bug_v3 branch Apr 2, 2019

@richvdh richvdh added this to In progress in Homeserver Task Board via automation Apr 4, 2019

@richvdh richvdh moved this from In progress to Done in Homeserver Task Board Apr 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.