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: Use timeout for Dial in secops forwarder #2131

Conversation

dpaasman00
Copy link
Contributor

@dpaasman00 dpaasman00 commented Jan 30, 2025

Proposed Change

Call the Dial functions with a timeout to exit early in the case of a bad IP address.

Uses the timeout already present in the configuration from the squashed confignet.AddrConfig. This way when BP starts adding this param to the exporter config it is backwards compatible

Checklist
  • Changes are tested
  • CI has passed

@dpaasman00 dpaasman00 marked this pull request as ready for review January 30, 2025 19:52
@dpaasman00 dpaasman00 requested a review from a team as a code owner January 30, 2025 19:52
@dpaasman00 dpaasman00 requested a review from schmikei January 30, 2025 19:52
Comment on lines +61 to +63
d := new(net.Dialer)
d.Timeout = fc.timeout
return tls.DialWithDialer(d, network, addr, config)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is meant to be identical to what tls.Dial normally does except we're setting a timeout instead now: https://cs.opensource.google/go/go/+/refs/tags/go1.23.5:src/crypto/tls/tls.go;l=173

@mrsillydog mrsillydog removed the request for review from schmikei January 30, 2025 20:06
@dpaasman00 dpaasman00 force-pushed the dakotapaasman/bpop-1720-bdot-long-delay-when-rolling-out-a-config-with-non-working branch from 4966c3c to e41d447 Compare January 31, 2025 01:19
@dpaasman00 dpaasman00 merged commit ccae0b6 into release/v1.70.0 Jan 31, 2025
15 checks passed
@dpaasman00 dpaasman00 deleted the dakotapaasman/bpop-1720-bdot-long-delay-when-rolling-out-a-config-with-non-working branch January 31, 2025 02:13
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.

2 participants