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

ecn bug #4178

Closed
heixiaoma opened this issue Nov 22, 2023 · 5 comments · Fixed by #4456
Closed

ecn bug #4178

heixiaoma opened this issue Nov 22, 2023 · 5 comments · Fixed by #4456

Comments

@heixiaoma
Copy link

Currently, I am using the gomobile library to compile into an AAR package for use in Android. Specifically, version 0.39 works fine on my Android phone. However, when I upgraded to version 0.4, I encountered the "sendmsg: invalid argument" issue. Fortunately, I was able to resolve this problem by using the code os.Setenv("QUIC_GO_DISABLE_ECN", "true"). I suspect there might be compatibility issues with ECN in version 0.4, but I am unsure how to express it precisely.

@tobyxdd
Copy link
Contributor

tobyxdd commented Nov 23, 2023

I can confirm this. My project has seen a lot of users getting "sendmsg: invalid argument" caused by ECN. I guess we should have ECN detection, something similar to isGSOSupported?

@heixiaoma
Copy link
Author

IMG_3031
I set environment variables based on error messages, prioritizing ecn and then gso. If there is a failure, a reconnection will be attempted. This should be considered compatible for now.

@marten-seemann
Copy link
Member

@heixiaoma You shouldn't need the QUIC_GO_DISABLE_GSO code path. quic-go does that automatically now. Also note that these environment variables shouldn't be set dynamically, as they won't apply to old connections.

I can confirm this. My project has seen a lot of users getting "sendmsg: invalid argument" caused by ECN. I guess we should have ECN detection, something similar to isGSOSupported?

I'm not opposed to that. However, ideally I'd like this to be more specific than just matching an invalid argument error code. Going forward, we'll probably set more and not less cmsgs to enable various socket optimizations, so it would be really valuable if we could tell them apart. Any idea?

@heixiaoma
Copy link
Author

@heixiaoma You shouldn't need the QUIC_GO_DISABLE_GSO code path. quic-go does that automatically now. Also note that these environment variables shouldn't be set dynamically, as they won't apply to old connections.

I can confirm this. My project has seen a lot of users getting "sendmsg: invalid argument" caused by ECN. I guess we should have ECN detection, something similar to isGSOSupported?

I'm not opposed to that. However, ideally I'd like this to be more specific than just matching an invalid argument error code. Going forward, we'll probably set more and not less cmsgs to enable various socket optimizations, so it would be really valuable if we could tell them apart. Any idea?

"You're right. Currently, it seems like this is the only solution. If there are specific error messages or ways to check if Ecn is supported in order to configure it, that would be even better."

@joliveirinha
Copy link
Contributor

adding some extra data point to this.

I was able to reproduce this problem as well while running on a docker within a synology NAS.
Seems like the detection for ECN support is not working properly.

Disabling it manually via the ENV variable fixed the problem.

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 a pull request may close this issue.

4 participants