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

Cannot run collocated tests with IPv6 #3154

Open
pepone opened this issue Nov 15, 2024 · 6 comments · Fixed by #3161
Open

Cannot run collocated tests with IPv6 #3154

pepone opened this issue Nov 15, 2024 · 6 comments · Fixed by #3161

Comments

@pepone
Copy link
Member

pepone commented Nov 15, 2024

When using IPv6 collocated test doesn't work. The issue is that the proxy endpoint doesn't match the published endpoint

The reference uses the 0:0:0:0:0:0:0:1 from the default host set by the scripts, and the published endpoint uses ::1

This affects C++ and C#, Java works fine with 0:0:0:0:0:0:0:1

(/home/jose/Documents/3.8/ice/cpp/test/Ice/adapterDeactivation/build/x86_64-linux-gnu/shared/collocated --Ice.Default.Host=0:0:0:0:0:0:0:1 --Ice.Warn.Connections=1 --Ice.Default.Protocol=tcp --Ice.IPv6=1 --Ice.PreferIPv6Address=1 --Ice.PrintStackTraces=1 env={'LD_LIBRARY_PATH': '/home/jose/Documents/3.8/ice/cpp/lib/x86_64-linux-gnu'})
creating/destroying/recreating object adapter... ok
creating/activating/deactivating object adapter in one operation... 
error: src/Ice/ConnectionI.cpp:2387 ::Ice::ConnectTimeoutException connection establishment timed out
stack trace:
  0 Ice::Exception::Exception(char const*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) in /home/jose/Documents/3.8/ice/cpp/test/Ice/adapterDeactivation/build/x86_64-linux-gnu/shared/../../../../../../lib/x86_64-linux-gnu/libIce.so.38a0
  1 /home/jose/Documents/3.8/ice/cpp/test/Ice/adapterDeactivation/build/x86_64-linux-gnu/shared/../../../../../../lib/x86_64-linux-gnu/libIce.so.38a0(+0x126ab8) [0x7661c3f26ab8]
  2 /home/jose/Documents/3.8/ice/cpp/test/Ice/adapterDeactivation/build/x86_64-linux-gnu/shared/../../../../../../lib/x86_64-linux-gnu/libIce.so.38a0(+0x14100a) [0x7661c3f4100a]
  3 IceInternal::Timer::run() in /home/jose/Documents/3.8/ice/cpp/test/Ice/adapterDeactivation/build/x86_64-linux-gnu/shared/../../../../../../lib/x86_64-linux-gnu/libIce.so.38a0
  4 /lib/x86_64-linux-gnu/libstdc++.so.6(+0xecdb4) [0x7661c3aecdb4]
  5 /lib/x86_64-linux-gnu/libc.so.6(+0x9ca94) [0x7661c369ca94]
  6 /lib/x86_64-linux-gnu/libc.so.6(+0x129c3c) [0x7661c3729c3c]
@pepone pepone added this to the 3.8.0 milestone Nov 15, 2024
@pepone
Copy link
Member Author

pepone commented Nov 15, 2024

I think we have to update collocated test to set PublishedHost to the value returned by the test helper getTestHost. This is always the same as Ice.Default.Host.

@pepone pepone self-assigned this Nov 15, 2024
@bernardnormier
Copy link
Member

Not sure that's the correct fix. It sounds like a bug in the hostname/address comparison performed by isLocal.

@bernardnormier
Copy link
Member

bernardnormier commented Nov 15, 2024

It's not immediately clear why it works in Java but not C++ and C#. The logic appears identical in all 3 languages. They rely on IPEndpointI.equivalent, that as far as I can tell, makes a straight string comparison for the host. So it shouldn't work in Java either.

@bernardnormier
Copy link
Member

Another possible solution: fix the test scripts to be consistent, and use ::1 everywhere.

*** [1/1] Running cpp/Ice/adapterDeactivation tests ***
[ running client/server test - 11/15/24 15:26:36 ]
- Config: ipv6
(/Users/bernard/builds/ice/cpp/test/Ice/adapterDeactivation/build/macosx/shared/server --Ice.Default.Host=::1 --Ice.Warn.Connections=1 --Ice.Default.Protocol=tcp --Ice.IPv6=1 --Ice.PreferIPv6Address=1 --Ice.PrintStackTraces=1 --Ice.ThreadPool.Server.Size=1 --Ice.ThreadPool.Server.SizeMax=3 --Ice.ThreadPool.Server.SizeWarn=0 --Ice.PrintAdapterReady=1)
(/Users/bernard/builds/ice/cpp/test/Ice/adapterDeactivation/build/macosx/shared/client --Ice.Default.Host=::1 --Ice.Warn.Connections=1 --Ice.Default.Protocol=tcp --Ice.IPv6=1 --Ice.PreferIPv6Address=1 --Ice.PrintStackTraces=1)
creating/destroying/recreating object adapter... ok
creating/activating/deactivating object adapter in one operation... ok
testing connection closure... ok
testing object adapter published endpoints... ok
testing object adapter published host... ok
testing object adapter with bi-dir connection... ok
testing object adapter with router... ok
testing object adapter creation with port in use... ok
deactivating object adapter in the server... ok
testing whether server is gone... ok
testing server idle time...ok
[ running collocated test - 11/15/24 15:26:38 ]
- Config: ipv6
(/Users/bernard/builds/ice/cpp/test/Ice/adapterDeactivation/build/macosx/shared/collocated --Ice.Default.Host=0:0:0:0:0:0:0:1 --Ice.Warn.Connections=1 --Ice.Default.Protocol=tcp --Ice.IPv6=1 --Ice.PreferIPv6Address=1 --Ice.PrintStackTraces=1)

Why are we using ::1 for non-colloc and 0:0:0:0:0:0:0:1 for colloc?

@pepone
Copy link
Member Author

pepone commented Nov 16, 2024

In C++ and C# expandHost returns ::1 for 0:0:0:0:0:0:0:1

@bernardnormier
Copy link
Member

#3161 was not a complete fix.

We still need to:

  • run at least one test with ipv6 and colloc (when running the tests with --all)
  • fix C++ and C# (and possibly JS) to implement IPEndpoint::equivalent with "normalized" IPv6 addresses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants