Skip to content

Commit d61bdff

Browse files
Remove SYNAPSE_USE_FROZEN_DICTS environment variable (#18123)
I got rid of the `SYNAPSE_USE_FROZEN_DICTS` environment variable because it will be overridden by the Synapse worker apps anyway and if we want to support `SYNAPSE_USE_FROZEN_DICTS`, it should be in `synapse/config/server.py`. It's also not documented so I'm assuming no one is using it anyway. Spawning from looking at the frozen dict stuff during the review of #18103 (comment)
1 parent 4d2c4ce commit d61bdff

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

changelog.d/18123.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove undocumented `SYNAPSE_USE_FROZEN_DICTS` environment variable.

synapse/events/__init__.py

+9-10
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import abc
2424
import collections.abc
25-
import os
2625
from typing import (
2726
TYPE_CHECKING,
2827
Any,
@@ -48,21 +47,21 @@
4847
from synapse.types import JsonDict, StrCollection
4948
from synapse.util.caches import intern_dict
5049
from synapse.util.frozenutils import freeze
51-
from synapse.util.stringutils import strtobool
5250

5351
if TYPE_CHECKING:
5452
from synapse.events.builder import EventBuilder
5553

56-
# Whether we should use frozen_dict in FrozenEvent. Using frozen_dicts prevents
57-
# bugs where we accidentally share e.g. signature dicts. However, converting a
58-
# dict to frozen_dicts is expensive.
59-
#
60-
# NOTE: This is overridden by the configuration by the Synapse worker apps, but
61-
# for the sake of tests, it is set here while it cannot be configured on the
62-
# homeserver object itself.
6354

64-
USE_FROZEN_DICTS = strtobool(os.environ.get("SYNAPSE_USE_FROZEN_DICTS", "0"))
55+
USE_FROZEN_DICTS = False
56+
"""
57+
Whether we should use frozen_dict in FrozenEvent. Using frozen_dicts prevents
58+
bugs where we accidentally share e.g. signature dicts. However, converting a
59+
dict to frozen_dicts is expensive.
6560
61+
NOTE: This is overridden by the configuration by the Synapse worker apps, but
62+
for the sake of tests, it is set here because it cannot be configured on the
63+
homeserver object itself.
64+
"""
6665

6766
T = TypeVar("T")
6867

0 commit comments

Comments
 (0)