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

java.net.preferIPv4Stack causing delays on IPv6 enabled hosts #760

Closed
gionn opened this issue Jan 23, 2024 · 6 comments
Closed

java.net.preferIPv4Stack causing delays on IPv6 enabled hosts #760

gionn opened this issue Jan 23, 2024 · 6 comments
Labels
bug Something isn't working as expected tracked Issue is being tracked internally

Comments

@gionn
Copy link
Member

gionn commented Jan 23, 2024

Configuring NGINX with locahost has the side effect of causing errors when trying the IPV6 [::1] loopback address, which is the preferred by the system, because Tomcat is only listenting on IPv4 because of the use of the java.net.preferIPv4Stack directive. Connections eventually succeed because NGINX then tries the 127.0.0.1 address that is resolved too, but it is at minimum an annoyance that polutes the error log, and can be seen too as a performance degradation issue, though minimal.

We'd like to know if there's some profound reason for explicitly restricting Tomcat to use IPv4, before goin on and removing that flag to make IPv6 connections work.

Originally posted by @jalvarezferr in #758 (comment)

@gionn
Copy link
Member Author

gionn commented Jan 23, 2024

We'd like to know if there's some profound reason for explicitly restricting Tomcat to use IPv4

it's there since years, I guess it's a workaround for hosts with IPv6 not properly configured, but the proper fix is usually to disable IPv6 via net.ipv6.conf.all.disable_ipv6 = 1 and not on a per-process basis.

I guess we can do some cleanup of all the java.net.preferIPv4Stack and see what happens.

@gionn gionn added the bug Something isn't working as expected label Jan 23, 2024
@alxgomz
Copy link
Contributor

alxgomz commented Jan 23, 2024

Setting net.ipv6.conf.all.disable_ipv6 sounds very intrusive.
IIRC the java option was introduced to circumvent issues with some clustering stack (probably jgroup at that time). It's worth testing again without this option but I'm not for setting /proc/sys/ params unless that really prevents the system from working (which is not the case here)

@jalvarezferr
Copy link

I agree that disabling IPv6 at the OS level through net.ipv6.conf.all.disable_ipv6 = 1 can't be the solution. It has many potential implications to other system services, and it is contrary to general good principle of using IPv6.

@gionn
Copy link
Member Author

gionn commented Jan 24, 2024

I apologize for any confusion caused by my previous message: my intention was not to propose a global disabling of IPv6 in the playbook. Instead, I was referencing it as a potential solution for users encountering issues related to IPv6 misconfiguration on their own hosts.

The primary focus remains on resolving the existing issue by removing all occurrences of java.net.preferIPv4Stack since hosts network configuration should not be really a concern of this playbook.

@alxgomz
Copy link
Contributor

alxgomz commented Feb 27, 2024

tracked in OPSEXP-2536

@alxgomz alxgomz added the tracked Issue is being tracked internally label Feb 28, 2024
@alxgomz
Copy link
Contributor

alxgomz commented Feb 29, 2024

should be resolved in 2.6.0

@alxgomz alxgomz closed this as completed Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected tracked Issue is being tracked internally
Projects
None yet
Development

No branches or pull requests

3 participants