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

Cancellable requests #40

Closed
MadLittleMods opened this issue Jul 13, 2022 · 0 comments · Fixed by #204
Closed

Cancellable requests #40

MadLittleMods opened this issue Jul 13, 2022 · 0 comments · Fixed by #204
Labels
dev-notes T-Enhancement New feature or request

Comments

@MadLittleMods
Copy link
Contributor

MadLittleMods commented Jul 13, 2022

If someone cancels a long-running request in their browser, will we stop trying to talk to the Matrix homeserver? I assume we will continue to process the request as if nothing happened and seems to be the case according to https://stackoverflow.com/questions/35198208/handling-cancelled-request-with-express-node-js-and-angular

At the moment, the HTTP timeout for the app deployment in Red Hat OpenShift is 30 seconds while Synapse's timeout is 180 seconds (I think 120 seconds on matrix.org) so we often run into the scenario where the archive gets a 504 Gateway Timeout but are probably talking to the homeserver a lot more afterwards. Especially in some cases where every request is just slow (join, /timestamp_to_event, /context, /messages).

Synapse has recently been implementing cancellable requests so it will work on a granular level with them.

This is a minor thing for now so we can leave this for down the road.

Dev notes

I've implemented a cancellable request in Express once for the Gitter export resources since we stream out the data there and it can take a while.

let isRequestCanceled = false;
req.on('close', function() {
  isRequestCanceled = true;
});

Notes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-notes T-Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant