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

Some generated methods lacking ConfigureAwait(false) #1555

Open
brianpursley opened this issue May 6, 2024 · 4 comments
Open

Some generated methods lacking ConfigureAwait(false) #1555

brianpursley opened this issue May 6, 2024 · 4 comments

Comments

@brianpursley
Copy link
Contributor

Describe the bug
I was looking at something else and noticed some of the generated methods lack a ConfigureAwait(false) and do not dispose _result like the other methods do.

Here is the code I'm referring to:

var _result = await operations.{{GetMethodName api.operation "WithHttpMessagesAsync"}}(
{{ for parameter in api.operation.parameters}}
{{GetDotNetNameOpenApiParameter parameter "false"}},
{{end}}
null,
cancellationToken);

Is this by design, or should it have ConfigureAwait(false) and using var _result like the other operations?

Kubernetes C# SDK Client Version
v13

Server Kubernetes Version
n/a

Dotnet Runtime Version
n/a

To Reproduce
n/a

Expected behavior
n/a

KubeConfig
n/a

Where do you run your app with Kubernetes SDK (please complete the following information):
n/a

Additional context
n/a

@tg123
Copy link
Member

tg123 commented May 6, 2024

good catch could you please send pr to fix

@brianpursley
Copy link
Contributor Author

good catch could you please send pr to fix

Sure.

/assign

@brianpursley
Copy link
Contributor Author

Looking into it a little more, I don't think these methods actually work, or don't work anymore if they did previously.

When I try to use ConnectGetNamespacedPodExecAsync, I get an HTTP 400 error with the message Upgrade request required.

So I'm guessing this is a bigger issue, that the client should support handling an upgrade request from the server, to switch to websockets (probably not worth worrying about SPDY at this point since it is being deprecated).

I see that there already is a client.WebSocketNamespacedPodExecAsync and it works, but it is not generated from the swagger. I don't know, maybe this is sufficient for the purposes of this client, but if that is the case, what, if anything should be done with the generated methods that don't work?

I'll take a look at it a little more when I get some time, to see how handling the upgrade might work. Maybe I'll look at some of the other clients to see what they're doing.

@tg123
Copy link
Member

tg123 commented May 8, 2024

cleaning up watch and streaming (connect) is on my todo list for long
the first step is to refactor the template system which got merge recently

however, i believe websocket related is still working as you tested.
another todo is to support http2

thanks for reporting it

@brianpursley brianpursley removed their assignment May 22, 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

No branches or pull requests

2 participants