Skip to content
This repository has been 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 5 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 workers turinging into a zombie processes if opentracing is enabled in the config but not installed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"turinging"

"a zombie processes"

zombie processes are a specific thing in unix-like OSes (https://en.wikipedia.org/wiki/Zombie_process), and I don't think they are quite what you have. you could just say 'Stop synapse worker processes from hanging' or something like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't actually been able to replicate the bug as it was described to me, however the fix is a feature so I've changed it to that.

7 changes: 7 additions & 0 deletions 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 @@ -32,6 +34,11 @@ def read_config(self, config, **kwargs):
if not self.opentracer_enabled:
return

try:
check_requirements("opentracing")
except DependencyException as e:
raise ConfigError(e.message)

# The tracer is enabled so sanitize the config

self.opentracer_whitelist = opentracing_config.get("homeserver_whitelist", [])
Expand Down