Skip to content

fix(search-jobs): add timeout to authenticated HTTP requests - #1360

Open
bunlongheng wants to merge 1 commit into
sourcegraph:mainfrom
bunlongheng:fix/search-jobs-http-timeout
Open

fix(search-jobs): add timeout to authenticated HTTP requests#1360
bunlongheng wants to merge 1 commit into
sourcegraph:mainfrom
bunlongheng:fix/search-jobs-http-timeout

Conversation

@bunlongheng

Copy link
Copy Markdown

fetchJobLogs and fetchJobResults both issue authenticated GETs via http.DefaultClient, which has no timeout. A slow or unresponsive Sourcegraph instance will stall the CLI indefinitely while the connection stays open with the caller's access token attached. Replaced the bare DefaultClient with a local http.Client{Timeout: 60 * time.Second} in both callers.

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.

1 participant