-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: resolve Dalli::Server deprecation in 3.0+ #1015
Conversation
|
I am seeing these failures locally, but was hoping it was just bad local setup/configuration:
I'm not really sure what's broken here. I've done this same change on a different instrumentation tool (not OTEL) that used the same approach to prepend Is there something I'm missing related to configuring Memcached with the second appraisal bundle gemfile maybe? |
@tierra Has something changed between versions? Does the Binary Protocol version have built in retries where the older versions do not? |
petergoldstein/dalli#783 made a reconnect change that I think affects It's possible the difference here is just in how the unit tests mock the connection failure behaviors. |
As far as I understand it, I'm not entirely clear about any of this though. |
@tierra it does seem like the test is simulating an error https://github.com/open-telemetry/opentelemetry-ruby/blob/main/instrumentation/dalli/test/opentelemetry/instrumentation/dalli/instrumentation_test.rb#L83 It may be the case that switching to optimistic versioning pulls in a version with retry logic because it will pull in any version greater than 2.7 |
It probably helps if I mention that I have an application in production that's already upgraded to Dalli 3.0, while also configured to use this instrumentation, and I've already verified that it's still properly recording spans for Dalli calls from this (it's just the addition of the deprecation warnings in logs that has brought me here). So that's another reason I suspect that the test failures here are likely due to the way the unit tests here mock internal implementation behaviors (and are failing due to Dalli internal implementation changes in 3.0). |
It looks like I was not clear that I agreed with you. Since this tests is mocking the library itself and generating an error and retries where introduced, then what I believe is happening here is that the system under test generating multiple spans, one for each retry. Based on the warning output from the test log it does indeed seem to be retrying:
I think that means you will have to update the test to satisfy this scenario. That may mean changing the test to mock it in a different way or triggering the error without using a mock and updating the assertions. Does that help clarify what I was alluding to in my previous comments? |
Hello friends, Took a quick look here and then took a longer look because I too was confused by this. Anyway I think what happens is that actually the underlying behavior of Anyway @tierra if you wouldn't mind adding that patch to your branch that should get all the tests working and we can get this merged. ty for the pr here as well!
|
Thank you @ericmustin! Your change does fix the tests in local when using Dalli 3.0. It also still works with 2.7 as well. I've updated the PR. I think it requires review to run PR builds, but should be good to go now. |
Dalli 3.0 has deprecated
Dalli::Server
in petergoldstein/dalli#760I believe the fix is simply to use
Dalli::Protocol::Binary
instead, when Dalli >=3.0 is detected (while still usingDalli::Server
in <3.0).I've created a new Appraisal config to test this with Dalli 3.0, while still also testing 2.7.
Related: Dalli 3.0 Upgrade Guide