Metrics: one transient allocation failure disables the registry forever
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- c
- Domain
- observability
Research direction
Locate the metrics registry implementation containing cwist_metrics_registry_init() and cwist_metrics_registry(), and trace how the pthread_once wrapper prevents retries after allocation failure. Rework initialization to use a mutex plus an initialized flag, or a statically allocated registry, then add a test that forces the first allocation to fail and confirms a later call succeeds. Done means repeated calls recover from a transient allocation failure and the new fail-then-succeed test passes.
Written by the indexing model from the issue text.
Description
cwist_metrics_registry_init() leaves g_reg NULL on allocation failure, but cwist_metrics_registry() wraps it in pthread_once. Later calls never retry initialization even after memory becomes available, permanently disabling metrics for the process. Make initialization retryable with a mutex and an initialized flag, or use a statically allocated registry, and add a fail-then-succeed test.
- Dominant language
- C
- Stars
- 16
- Forks
- 7
- Avg merge
- 4h 17m
- Merged PRs (30d)
- 198
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from c4punks/CWIST
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug critical
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
GXF: heap buffer overflow in parse_ad_cdp() — unbounded cc_count in CDP cc data sectionPossibly taken @pranayr710 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
CCExtractor/ccextractor#2498 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
area: services kind: bug preview-effort: small priority: low
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Static Analysis failurePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100