MatrixSynapse/synapse
Sean Quah d0de452d12
Fix `HomeServer`s leaking during `trial` test runs (#15630)
This change fixes two memory leaks during `trial` test runs.

Garbage collection is disabled during each test case and a gen-0 GC is
run at the end of each test. However, when the gen-0 GC is run, the
`TestCase` object usually still holds references to the `HomeServer`
used during the test. As a result, the `HomeServer` gets promoted to
gen-1 and then never garbage collected.

Fix this by periodically running full GCs.

Additionally, fix `HomeServer`s leaking after tests that touch inbound
federation due to `FederationRateLimiter`s adding themselves to a global
set, by turning the set into a `WeakSet`.

Resolves #15622.

Signed-off-by: Sean Quah <seanq@matrix.org>
2023-05-19 11:17:12 +01:00
..
_scripts Add an admin API endpoint to support per-user feature flags (#15344) 2023-04-28 11:33:45 -07:00
api Implement MSC3821 to update redaction rules (`third_party_invite.signed`) (#15563) 2023-05-15 15:02:24 -04:00
app Update code to refer to "workers". (#15606) 2023-05-16 15:56:38 -04:00
appservice Stabilize MSC2659 support for AS ping endpoint. (#15528) 2023-05-09 15:02:36 -04:00
config Re-type config paths in `ConfigError`s to be `StrSequence`s (#15615) 2023-05-18 11:11:30 +01:00
crypto Factor out an `is_mine_server_name` method (#15542) 2023-05-05 15:06:22 +01:00
events Implement MSC3821 to update redaction rules (`third_party_invite.signed`) (#15563) 2023-05-15 15:02:24 -04:00
federation Factor out an `is_mine_server_name` method (#15542) 2023-05-05 15:06:22 +01:00
handlers Handle missing previous read marker event. (#15464) 2023-05-18 14:37:31 -04:00
http HTTP Replication Client (#15470) 2023-05-09 14:25:20 -04:00
logging Bump black from 22.12.0 to 23.1.0 (#15103) 2023-02-22 15:29:09 -05:00
media Apply url_preview_url_blacklist to oEmbed and pre-cached images (#15601) 2023-05-16 16:25:01 -04:00
metrics Bump black from 22.12.0 to 23.1.0 (#15103) 2023-02-22 15:29:09 -05:00
module_api Update code to refer to "workers". (#15606) 2023-05-16 15:56:38 -04:00
push Error if attempting to set m.push_rules account data, per MSC4010. (#15555) 2023-05-09 10:34:10 -04:00
replication Update code to refer to "workers". (#15606) 2023-05-16 15:56:38 -04:00
res Use oEmbed for YouTube Shorts (#15025) 2023-05-03 12:54:42 -04:00
rest Update Mutual Rooms (MSC2666) implementation (#15621) 2023-05-18 12:49:12 -04:00
server_notices Remove unused `room_alias` field from `/createRoom` response (#15093) 2023-02-22 11:07:28 +00:00
spam_checker_api Fix import in module_api module and docs on the new check_event_for_spam signature (#12918) 2022-05-31 12:04:53 +02:00
state Use immutabledict instead of frozendict (#15113) 2023-03-22 17:15:34 +00:00
static Remove registration fallback code. (#15405) 2023-04-13 11:36:29 -04:00
storage Handle missing previous read marker event. (#15464) 2023-05-18 14:37:31 -04:00
streams Use mypy 1.0 (#15052) 2023-02-16 16:09:11 +00:00
types Re-type config paths in `ConfigError`s to be `StrSequence`s (#15615) 2023-05-18 11:11:30 +01:00
util Fix `HomeServer`s leaking during `trial` test runs (#15630) 2023-05-19 11:17:12 +01:00
__init__.py Use immutabledict instead of frozendict (#15113) 2023-03-22 17:15:34 +00:00
event_auth.py Reject instead of erroring on invalid membership events. (#15564) 2023-05-15 15:01:29 -04:00
notifier.py Move ThirdPartyEventRules into module_api/callbacks (#15535) 2023-05-04 14:18:22 +00:00
py.typed Mark Module API error imports as re-exported and mark Synapse as containing type annotations (#11054) 2021-10-13 08:42:41 +01:00
server.py HTTP Replication Client (#15470) 2023-05-09 14:25:20 -04:00
visibility.py Refactor `filter_events_for_server` (#15240) 2023-03-10 15:31:25 +00:00