Skip to content

Conversation

@jhump
Copy link
Member

@jhump jhump commented May 29, 2024

Because the connect-go server framework will try to curtail work beyond the deadline, the timeout test cases weren't working quite as expected. They worked for unary, but for the streaming endpoints, the deadline would elapse and cause the server handler's stream interactions to return a deadline_exceeded error, which it would then return to the client. So the client was correctly reporting a deadline_exceeded error for the streaming tests, even when it didn't actually enforce a deadline.

So this change causes the reference server to remove the timeout headers, so that the connect-go framework it is built on will not bother trying to enforce any client-provided deadline. In order to actually validate the client deadline in these cases, the timeout is parsed (by the same code that removes it from the headers) and is stored off separately (in a context value), for retrieval from the server handler.

cc @rebello95

Comment on lines +52 to +64
type int32Enum interface {
~int32
protoreflect.Enum
}

type feedbackPrinter struct {
p internal.Printer
testCaseName string
}

func (p *feedbackPrinter) Printf(format string, args ...any) {
p.p.PrefixPrintf(p.testCaseName, format, args...)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

I moved these up to conform to our style guide, which wants types (and their methods) to appear above functions.

@jhump jhump requested a review from smaye81 May 29, 2024 19:11
@jhump jhump changed the title Require that client implementations properly enforce timeouts. Require that client implementations properly enforce timeouts May 29, 2024
…connect-go server lib will not constraint the execution of the server handler; this lets us test whether the client is actually enforcing the timeout vs just sending along a timeout header

Signed-off-by: Josh Humphries <[email protected]>
@jhump jhump force-pushed the jh/ref-server-requires-client-to-enforce-timeout branch from c8021f7 to 175bce3 Compare May 29, 2024 19:14
@jhump jhump merged commit e140513 into main May 29, 2024
@jhump jhump deleted the jh/ref-server-requires-client-to-enforce-timeout branch May 29, 2024 19:58
@jhump jhump mentioned this pull request Aug 13, 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.

3 participants