Skip to content

[Style] Fix golangci-lint rule: noctx #2142

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

Merged

Conversation

MortalHappiness
Copy link
Member

@MortalHappiness MortalHappiness commented May 11, 2024

Why are these changes needed?

Based on #2128, there are some rules that need manual fixing. This PR fixes the rule: noctx

See https://golangci-lint.run/usage/linters/ for details.

Related issue number

N/A

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

@MortalHappiness MortalHappiness marked this pull request as draft May 11, 2024 22:07
Signed-off-by: Chi-Sheng Liu <chishengliu@chishengliu.com>
@MortalHappiness MortalHappiness force-pushed the feature/golangci-lint-noctx branch from 7bebb21 to 0fc782a Compare May 13, 2024 18:49
@MortalHappiness MortalHappiness marked this pull request as ready for review May 13, 2024 18:49
@@ -50,7 +50,11 @@ func (r *RayHttpProxyClient) SetHostIp(hostIp, podNamespace, podName string, por

// CheckProxyActorHealth checks the health status of the Ray Serve proxy actor.
func (r *RayHttpProxyClient) CheckProxyActorHealth(ctx context.Context) error {
resp, err := r.client.Get(r.httpProxyURL + RayServeProxyHealthPath)
req, err := http.NewRequestWithContext(ctx, http.MethodGet, r.httpProxyURL+RayServeProxyHealthPath, nil)
Copy link
Member

Choose a reason for hiding this comment

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

Note: "You should use noctx if sending http request in your library. Passing context.Context enables library user to cancel http request, getting trace information and so on."

https://github.com/sonatard/noctx

@kevin85421 kevin85421 merged commit 4eedc32 into ray-project:master May 15, 2024
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