-
Notifications
You must be signed in to change notification settings - Fork 169
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
Controller crash on nil pointer deference during - now at different location #1460
Comments
Hi @arunsworld , The VersionInfo gets set in accept.go. If the VersionInfo isn't present or can't be parsed, we now close the connection instead of continuing processing. The Router with the VersionInfo set is then placed in the connected routers map. The only time something is placed in that map is from accept. We never clear VersionInfo. Part of the fix was to always grab the router from the connected routers map. Anyway, I can add some debug logging which may help us get to the bottom of this. Let me know if that's something you want to pursue. I'm surprised we're not seeing this as we're hosting lots of ziti networks and I get notified whenever there's a panic. Regarding code style: I agree about the setters/getters and I think newer code doesn't suffer from those issues. We try to fix those things as we come across them. We've gotten much more comfortable in Go since the project has started and I think the code is much cleaner and more idiomatic these days. In general I personally try to only add setters/getters when it's needed for an interface. Regarding One is single letter variable names. I think there's a happy medium between a, b, c and superLongOverlyDescriptiveVariableName. The other is the advice to not use names like |
Also, I realized I forgot to mention - I know I could just wrap that line in a nil check, but since that should never be nil, I want to track down the actual root cause, rather than bandaid it. If we can't figure out, I can always do the bandaid later. |
Sure; happy to build from a debug branch and running that and hopefully reproduce the problem. Please let me know once there is a ready branch. Thanks. |
I'll put together a branch today and post it here |
I've pushed some changes to the Let me know how it looks. Appreciate you helping track this down. |
Thanks. I've deployed from this branch all controllers and routers. Hopefully will be able to reproduce the panic soon; and I'll have the logs here presently. |
FYI: The potential fix included in the debug branch was released in 0.31.0. Even if it doesn't fix the bug it made the code a bit cleaner, so I went ahead and pushed it through. |
Closing. If this is still an issue, please re-open. |
Stack trace:
Branch: fix-router-connect-panic
Part of the longevity test to check if issue #1423 was fixed.
I see that there is null checking above for logging but in line 500 it's unchecked.
If I may also suggest, a lot of the code I've looked at is very "Java". Setters and Getters and self. if it were more idiomatic Go, it would be easier on Go devs and leverage the simplicity and semantic principles foundational in the language.
The text was updated successfully, but these errors were encountered: