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

Immediately return ErrTimeout if deadline is already reached. #1497

Merged
merged 2 commits into from
Mar 3, 2023
Merged

Immediately return ErrTimeout if deadline is already reached. #1497

merged 2 commits into from
Mar 3, 2023

Conversation

iv-menshenin
Copy link
Contributor

@iv-menshenin iv-menshenin commented Feb 16, 2023

I found this while developing unit tests for my application.

If we call DoDeadline without first checking that the deadline has expired, then we don't get the expected behavior of returning ErrTimeout.

The implementation (c *pipelineConnClient) of DoDeadline already contains the necessary check

	if req.timeout < 0 {
		return ErrTimeout
	}

I also added it for

  • Client
  • HostClient

client.go Show resolved Hide resolved
@erikdubbelboer erikdubbelboer merged commit 74a0507 into valyala:master Mar 3, 2023
@erikdubbelboer
Copy link
Collaborator

Thanks!

@iv-menshenin iv-menshenin deleted the already-deadlined branch March 9, 2023 11:44
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.

3 participants