Skip to content

Go: Fix Timeout Casting in time.Duration #3933

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

edlng
Copy link
Collaborator

@edlng edlng commented May 21, 2025

time.Duration has the duration in nanoseconds. We need to ensure our casting is proper and valid to prevent any undefined behavior from occurring.

Issue link

This Pull Request is linked to issue (URL): closes #3931

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one issue.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated.
  • CHANGELOG.md and documentation files are updated.
  • Destination branch is correct - main or release
  • Create merge commit if merging release branch into main, squash otherwise.

@edlng edlng self-assigned this May 21, 2025
@edlng edlng added the go golang wrapper label May 21, 2025
@edlng edlng marked this pull request as ready for review May 21, 2025 21:14
@edlng edlng requested a review from a team as a code owner May 21, 2025 21:14
@edlng edlng requested a review from jbrinkman May 21, 2025 21:18
@edlng
Copy link
Collaborator Author

edlng commented May 21, 2025

@jbrinkman I decided to do the casting work in WithRequestTimeout and WithConnectionTimeout instead since I think it allows for simpler code. I've redefined the config types to be uint32 so it can be passed directly into the protobuf request. Let me know your thoughts on these changes disregard this comment. I've changed it back after addressing the comments

edlng added 4 commits May 22, 2025 09:11
Signed-off-by: Edward Liang <[email protected]>
Signed-off-by: Edward Liang <[email protected]>
Signed-off-by: Edward Liang <[email protected]>
@edlng edlng force-pushed the go/edlng-fix-timeout-cast branch from 09177bc to 927bde0 Compare May 22, 2025 16:57
Signed-off-by: Edward Liang <[email protected]>
edlng added 2 commits May 23, 2025 11:31
Signed-off-by: Edward Liang <[email protected]>
Signed-off-by: Edward Liang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go golang wrapper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Go: GlideClientConfiguration requestTimeout is using wrong measurement
3 participants