Skip to content
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

Jeffjo/fix excon error handler #426

Merged
merged 2 commits into from
May 31, 2018

Conversation

jeffjo
Copy link
Contributor

@jeffjo jeffjo commented May 11, 2018

See commit message for details. This manifested as dropped traces due to unclosed spans when a timeout occurs while making a request

@jeffjo jeffjo force-pushed the jeffjo/fix-excon-error-handler branch 2 times, most recently from 9061e22 to 29ed36b Compare May 15, 2018 18:53
handle_response(d)
end
handle_response(datum)
@stack.error_call(datum)
Copy link
Contributor

Choose a reason for hiding this comment

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

I see, we have to handle_response before calling the stack for error_call?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes - see commit message for a more detailed explanation. There's also evidence in the Excon::Middleware::Base class indicating that this is the order it should be:

https://github.com/excon/excon/blob/master/lib/excon/middlewares/base.rb#L11

ddtrace.gemspec Outdated
@@ -35,6 +35,7 @@ EOS
spec.add_dependency 'msgpack'

spec.add_development_dependency 'rake', '~> 10.5'
spec.add_development_dependency 'excon', '~> 0.62.0'
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should add this here. Excon is considered a "contrib", and we load these kind of external dependencies via Appraisals, which are used to drive tests. Development dependencies are for the gem itself.

@delner
Copy link
Contributor

delner commented May 22, 2018

Minor feedback, but looking good otherwise! Since this is a bugfix, I suggest rebasing this against master so it can roll with our next patch version.

@delner delner added bug Involves a bug integrations Involves tracing integrations community Was opened by a community member labels May 22, 2018
@delner delner added this to the 0.12.1 milestone May 22, 2018
The `Connection` class raises an error in its `error_call` method when
there is a timeout. Since the `Connection` class comes after this
middleware in the chain, this resulted in the span never being closed.
Now, the span is closed before passing control to the rest of the
middleware chain.
This test ensures that the Excon tracing middleware appears before the
Idempotent middleware so that a span will be created for every retried
request.
@jeffjo jeffjo force-pushed the jeffjo/fix-excon-error-handler branch from 29ed36b to b778104 Compare May 23, 2018 16:30
@jeffjo
Copy link
Contributor Author

jeffjo commented May 23, 2018

@delner I don't see the excon instrumentation on master. Should I rebase off a different branch?

@delner
Copy link
Contributor

delner commented May 23, 2018

@jeffjo Oh, I'm sorry, Excon is new to 0.13-dev, so we don't need to put this out in a patch release on master. Yeah, we can just merge this to 0.13-dev: sorry for the confusion.

@delner delner modified the milestones: 0.12.1, 0.13.0 May 23, 2018
Copy link
Contributor

@delner delner left a comment

Choose a reason for hiding this comment

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

Looks great; thanks for the contribution! 🎉

@delner delner merged commit 4f51eee into DataDog:0.13-dev May 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Involves a bug community Was opened by a community member integrations Involves tracing integrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants