element-hq / element-hq/synapse

Failed to call mallctl with metrics and jemalloc (version 1) enabled

Open
#10,731 0 comments 0 reactions 0 assignees View on GitHub
S-Minor T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#10731](https://github.com/matrix-org/synapse/issues/10731).

---

### Description

My logs are full of the following warnings
```
2021-08-31 22:02:23,539 - synapse.metrics.jemalloc - 176 - WARNING - sentinel - Failed to read jemalloc stats.resident: Failed to call mallctl
2021-08-31 22:02:23,539 - synapse.metrics.jemalloc - 176 - WARNING - sentinel - Failed to read jemalloc stats.metadata: Failed to call mallctl
```

### Steps to reproduce

- enable jemalloc by setting the environment variable e.g. `LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1`
- enable metrics collection

The server and metrics appear to still be working properly so I'm not sure what the impact of this warning is.

### Version information

- **Homeserver**: Other

If not matrix.org:

- **Version**: 1.41.1

- **Install method**: matrix.org Debian package repository

- **Platform**:

OS: Ubuntu 18.04.5 LTS
Virtualized: Yes

Contributor guide

Open the contributing guide

Research direction

Start at the synapse.metrics.jemalloc entry point named in the warnings and reproduce with metrics enabled and LD_PRELOAD set to libjemalloc.so.1. Compare the handling of failed mallctl calls for stats.resident and stats.metadata; done means the warnings are addressed without disrupting the server or metrics collection.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.