Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Cast a coroutine into a Deferred in the federation base #6996

Merged
merged 4 commits into from
Feb 26, 2020

Conversation

clokep
Copy link
Member

@clokep clokep commented Feb 26, 2020

FederationClient.get_pdu was made async/await in #6840 (released in 1.110rc1), but a caller of it was not converted. I'm guessing this was missed because FederationBase._check_sigs_and_hash_and_fetch has an inner function which calls back into FederationBase.get_pdu (see the mypy errors in #6995).

Note that FederationBase._check_sigs_and_hash_and_fetch is also used by FederationServer, so I believe there's potential for another bug here.

Part of #6978.

@clokep
Copy link
Member Author

clokep commented Feb 26, 2020

I was able to reproduce this with SyTest, I think.

@clokep
Copy link
Member Author

clokep commented Feb 26, 2020

An alternative to this might be to convert FederationBase to be async / await, but some of that code is gnarly with the things it does with Deferreds.

@clokep clokep requested a review from a team February 26, 2020 15:47
changelog.d/6996.bugfix Outdated Show resolved Hide resolved
@clokep
Copy link
Member Author

clokep commented Feb 26, 2020

We talked a bit about FederationBase calling a FederationClient method on Matrix, wanted to capture the results from rich:

I'm pretty sure I decided that FederationServer.on_query_auth_request had been broken forever and needed to die, which means that _check_sigs_and_hash_and_fetch can move to FederationClient
some more context: _on_query_auth_request implements an undocumented, unused REST endpoint

@clokep clokep changed the base branch from develop to release-v1.11.1 February 26, 2020 16:20
@clokep clokep merged commit 3801228 into release-v1.11.1 Feb 26, 2020
@clokep clokep deleted the clokep/coroutine-deferred branch February 26, 2020 16:32
@clokep clokep mentioned this pull request Jul 30, 2020
48 tasks
babolivier pushed a commit that referenced this pull request Sep 1, 2021
* commit '380122866':
  Cast a coroutine into a Deferred in the federation base (#6996)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants