Skip to content

fix: treat negative SetTimeout as zero (no timeout)#509

Closed
sonnemusk wants to merge 1 commit into
imroc:masterfrom
sonnemusk:fix/clamp-negative-timeout-retry
Closed

fix: treat negative SetTimeout as zero (no timeout)#509
sonnemusk wants to merge 1 commit into
imroc:masterfrom
sonnemusk:fix/clamp-negative-timeout-retry

Conversation

@sonnemusk

Copy link
Copy Markdown

Summary

SetTimeout(-1) stored a negative duration on the underlying http.Client. Zero already means "no timeout"; negative is undefined.

Clamp values below zero to zero.

Test plan

  • Unit test for negative and positive timeouts

http.Client documents zero as no timeout; a negative duration is
undefined and can cause surprising deadline behavior. Clamp below
zero to zero.
@sonnemusk

Copy link
Copy Markdown
Author

Closing after a second quality pass: too thin / low user impact. Prefer fewer high-signal fixes. Sorry for the noise.

@sonnemusk sonnemusk closed this Jul 23, 2026
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