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

Prevent multiple instances of shutting down the same room simultaneously #10797

Closed
anoadragon453 opened this issue Sep 10, 2021 · 2 comments · Fixed by #11223
Closed

Prevent multiple instances of shutting down the same room simultaneously #10797

anoadragon453 opened this issue Sep 10, 2021 · 2 comments · Fixed by #11223
Labels
S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@anoadragon453
Copy link
Member

We had a process attempt to shut down the same room using two, separate calls to the Admin API:

  • DELETE /_synapse/admin/v1/rooms/{roomId}
  • POST /_synapse/admin/v1/{roomId}/delete

Both of these method handlers eventually call RoomShutdownHandler.shutdown_room, and there doesn't look to be any code that deduplicates requests anywhere.

This lead to a state where two long-running shutdown processes for the same room occurred and choked the main processes' CPU, resulting in the need to restart the main process to recover its performance.

@anoadragon453 anoadragon453 added S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. labels Sep 10, 2021
@dklimpel
Copy link
Contributor

dklimpel commented Sep 10, 2021

Perhaps this API should return an ID like the purge room API. https:/matrix-org/synapse/blob/develop/docs/admin_api/purge_history_api.md#purge-status-query

Like this comment #7651 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants