Skip to content

Use object_id as cache key in CachingResolver#5719

Draft
dmilisic wants to merge 1 commit into
DataDog:masterfrom
dmilisic:patch-2
Draft

Use object_id as cache key in CachingResolver#5719
dmilisic wants to merge 1 commit into
DataDog:masterfrom
dmilisic:patch-2

Conversation

@dmilisic
Copy link
Copy Markdown

@dmilisic dmilisic commented May 8, 2026

What does this PR do?
Fix #5718 Segmentation fault in CachingResolver

Motivation:
Ocasional segfaults after upgrading from ddtrace (v1) to datadog (v2)

Change log entry

Additional Notes:
When using rails with multiple threads, each thread will have its own connection configuration Hash with a different object_id. So we can expect more cache entries, but we eliminate the overhead of comparing hashes.

We're running this fix in production for ~2 weeks without a single segfault. Previously, segfaults ocurred on a daily basis.

How to test the change?

Segmentation faults are difficult to reproduce. There should be no change in behaviour.

@ivoanjo
Copy link
Copy Markdown
Member

ivoanjo commented May 8, 2026

Thanks for sharing this! If the workaround I mentioned in #5718 (comment) is not enough, this provides us a really good hint where the interaction of the code in the Ruby VM might be going wrong... 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Segmentation fault in CachingResolver

2 participants