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

Blow up config if opentracing is missing #5985

Merged
merged 6 commits into from
Sep 12, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/5985.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix synapse zombifying if opentracing enabled but uninstalled.
9 changes: 8 additions & 1 deletion synapse/config/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from synapse.python_dependencies import DependencyException, check_requirements

from ._base import Config, ConfigError


Expand All @@ -29,7 +31,12 @@ def read_config(self, config, **kwargs):
{"sampler": {"type": "const", "param": 1}, "logging": False},
)

if not self.opentracer_enabled:
if self.opentracer_enabled:
try:
check_requirements("opentracing")
except DependencyException as e:
raise ConfigError(e.message)
else:
return

# The tracer is enabled so sanitize the config
Expand Down