MatrixSynapse/synapse/util
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
..
caches Bump black from 22.12.0 to 23.1.0 (#15103) 2023-02-22 15:29:09 -05:00
__init__.py Use immutabledict instead of frozendict (#15113) 2023-03-22 17:15:34 +00:00
async_helpers.py
batching_queue.py
cancellation.py
check_dependencies.py Bump black from 22.12.0 to 23.1.0 (#15103) 2023-02-22 15:29:09 -05:00
daemonize.py
distributor.py
file_consumer.py
frozenutils.py Use immutabledict instead of frozendict (#15113) 2023-03-22 17:15:34 +00:00
gai_resolver.py
hash.py
httpresourcetree.py
iterutils.py
linked_list.py
logcontext.py
logformatter.py
macaroons.py
manhole.py
metrics.py
module_loader.py Re-type config paths in `ConfigError`s to be `StrSequence`s (#15615) 2023-05-18 11:11:30 +01:00
msisdn.py Clean up and clarify "Create or modify Account" Admin API documentation (#15544) 2023-05-05 15:51:46 +01:00
patch_inline_callbacks.py Bump black from 22.12.0 to 23.1.0 (#15103) 2023-02-22 15:29:09 -05:00
ratelimitutils.py Fix `HomeServer`s leaking during `trial` test runs (#15630) 2023-05-19 11:17:12 +01:00
retryutils.py
rlimit.py
rust.py
stringutils.py
templates.py
threepids.py
wheel_timer.py