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

feat: expose DialContext in Dialer and propagate context #165

Merged
merged 7 commits into from
Jan 22, 2024

Conversation

kruskall
Copy link
Member

What does this PR do?

A dialer only exposed the Dial method, making it impossible to correctly propagate context along with timeouts and cancellations.

This PR exposes DialContext in the dialer interface.

The Dial method is kept for backward compatibility.

Why is it important?

We're using NetDialer to create a dialer in apm-server but we are forced to pass the Dial method to the http.Transport because DialContext is not exposed.

This prevents the context from being propagated

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.md

Author's Checklist

  • [ ]

Related issues

A dialer only exposed the Dial method, making it impossible to correctly
propagate context along with timeouts and cancellations
@kruskall kruskall requested a review from a team as a code owner November 17, 2023 18:58
@kruskall kruskall requested review from fearful-symmetry and faec and removed request for a team November 17, 2023 18:58
@pierrehilbert pierrehilbert added the Team:Elastic-Agent Label for the Agent team label Nov 18, 2023
transport/client.go Outdated Show resolved Hide resolved
transport/proxy.go Show resolved Hide resolved
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@kruskall kruskall requested a review from cmacknz January 19, 2024 21:41
@kruskall kruskall merged commit 4739839 into elastic:main Jan 22, 2024
6 checks passed
@kruskall kruskall deleted the feat/dialcontext branch January 22, 2024 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants