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

Deflake Join_should_succeed_when_joined_to_allowed_room subtest of restricted rooms tests #413

Merged
merged 1 commit into from
Jul 13, 2022

Conversation

DMRobertson
Copy link
Contributor

@DMRobertson DMRobertson commented Jul 13, 2022

This doesn't make it robust enough for Synapse to relax. There is another race whose details I would like to write down somewhere. Here will do.


There is a race of some kind in Join_should_succeed_when_invited where:

  • Alice invites Bob to a room
  • Bob tries to join it, but is told he cannot because he isn't a member of the allowed_room. (Synapse doesn't seem to recognise Bob's invite.)

It smells a lot like matrix-org/synapse#13185 (though not exactly the same). I have traced it down to some kind of inconsistent view of the world within Synapse.

 event_creator1 | 2022-07-13 12:42:03,329 - synapse.access.http.18013 - 450 - INFO - POST-8 - ::ffff:127.0.0.1 - 18013 - {@alice:hs1} Processed request: 0.078sec/0.000sec (0.009sec, 0.000sec) (0.003sec/0.026sec/14) 2B 200 "POST /_matrix/client/r0/rooms/%21gKKiEPeUuvMlLRcsYn:hs1/invite HTTP/1.0" "Go-http-client/1.1" [0 dbevts]
  event_creator1 | 2022-07-13 12:42:03,331 - synapse.http.servlet - 663 - WARNING - POST-9 - Unable to parse JSON: Expecting value: line 1 col  umn 1 (char 0) (b'')
  event_creator1 | 2022-07-13 12:42:03,331 - synapse.handlers.room_member - 661 - WARNING - POST-9 - DMR: effective_membership_state='join'
  event_creator1 | 2022-07-13 12:42:03,331 - synapse.handlers.room_member - 725 - WARNING - POST-9 - DMR: prev_event_ids=None
  event_creator1 | 2022-07-13 12:42:03,332 - synapse.handlers.room_member - 745 - WARNING - POST-9 - DMR: latest_event_ids=['$9NYsPEfWiCn6tVyGwSHpsTV7_6ptI-MZ6dg0MY3OhpM']
  event_creator1 | 2022-07-13 12:42:03,336 - synapse.handlers.room_member - 755 - WARNING - POST-9 - DMR: old_state_id='$9NYsPEfWiCn6tVyGwSHpsTV7_6ptI-MZ6dg0MY3OhpM'
  event_creator1 | 2022-07-13 12:42:03,337 - synapse.handlers.room_member - 759 - WARNING - POST-9 - DMR: old_membership='invite'
  event_creator1 | 2022-07-13 12:42:03,337 - synapse.handlers.room_member - 808 - WARNING - POST-9 - DMR: is_host_in_room=True
  event_creator1 | 2022-07-13 12:42:03,339 - synapse.handlers.room_member - 1038 - WARNING - POST-9 - DMR: prev_member_event_id='$10lGB5PerDiK5mwdJMEC2HF0xWOkS4nmcei4AUb4vus'
  event_creator1 | 2022-07-13 12:42:03,339 - synapse.handlers.room_member - 1042 - WARNING - POST-9 - DMR: prev_member_event.membership='leave'
  event_creator1 | 2022-07-13 12:42:03,339 - synapse.handlers.event_auth - 189 - WARNING - POST-9 - DMR: prev_member_event=<FrozenEventV3 event_id=$10lGB5PerDiK5mwdJMEC2HF0xWOkS4nmcei4AUb4vus, type=m.room.member, state_key=@bob:hs1, outlier=False>
  event_creator1 | 2022-07-13 12:42:03,339 - synapse.handlers.event_auth - 191 - WARNING - POST-9 - DMR: prev_member_event.membership='leave'
  event_creator1 | 2022-07-13 12:42:03,339 - synapse.http.server - 167 - INFO - POST-9 - <SynapseRequest at 0x7f4bfdf56130 method='POST' uri='/_matrix/client/r0/join/%21gKKiEPeUuvMlLRcsYn:hs1?server_name=hs1' clientproto='HTTP/1.0' site='18013'> SynapseError: 403 - You do not belong to any of the required rooms/spaces to join this room.
  event_creator1 | 2022-07-13 12:42:03,339 - synapse.access.http.18013 - 450 - INFO - POST-9 - ::ffff:127.0.0.1 - 18013 - {@bob:hs1} Processed request: 0.008sec/0.000sec (0.002sec, 0.000sec) (0.001sec/0.002sec/6) 108B 403 "POST /_matrix/client/r0/join/%21gKKiEPeUuvMlLRcsYn:hs1?server_name=hs1 HTTP/1.0" "Go-http-client/1.1" [1 dbevts]

old_membership='invite' but prev_member_event.membership='leave'???

@DMRobertson DMRobertson requested review from a team July 13, 2022 14:24
@DMRobertson DMRobertson changed the title Mitigate one race in the restricted room join test (another outstanding) Deflake Join_should_succeed_when_joined_to_allowed_room subtest of restricted rooms tests Jul 13, 2022
Copy link
Contributor

@squahtx squahtx left a comment

Choose a reason for hiding this comment

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

LGTM!

I don't think the dendrite test failures are a regression. They're failing on dendrite's develop branch too and they're in an unrelated test anyway.

@DMRobertson DMRobertson merged commit b894551 into main Jul 13, 2022
@DMRobertson DMRobertson deleted the dmr/msc3787-flake branch July 13, 2022 15:53
@neilalexander
Copy link
Contributor

Dendrite failures are waiting for #411 to be resolved.

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.

3 participants