zbentley opened a new issue #11950:
URL: https://github.com/apache/pulsar/issues/11950


   **Describe the bug**
   If I run Pulsar listening on 127.0.0.1:6650 and attempt to connect to 
`pulsar://localhost:6650` via the C++ client (Python bindings) I am unable to 
connect. If I change the connection string to `pulsar://127.0.0.1:6650` I am 
able to connect.
   
   This is a regression; the Python/C++ client available from PyPi 
(2.8.0.post0) is able to connect to `localhost`.
   
   This appears to be due to IPv4/v6 dualstack fallback not working the same 
between `master` and stable (see screenshots below for more info).
   
   
   **To Reproduce**
   1. Ensure Pulsar standalone is running and listening on the default local 
interface/port (I did not edit its config in any weya).
   2. Using a Python `pulsar-client` built against `master`, attempt to 
connect. I used this snippet: 
   ```python
   import pulsar
   c = pulsar.Client('pulsar://localhost:6650')
   ```
   3. Observe that a connection error is raised.
   4. Using the stable client available via `pip install pulsar-client`, run 
the same snippet.
   5. Observe that no connection error is raised.
   
   **Expected behavior**
   No connection error should be raised in either case. Both client versions 
should be able to connect to Pulsar.
   
   
   **Desktop (please complete the following information):**
    - OS: MacOS 10.11
   
   **Additional context**
   My Pulsar standalone is listening on localhost thus:
   ```
   ∴ sudo lsof -P -a -i -p $(pgrep -f pulsar) | grep LISTEN
   java    99692 zac.bentley  267u  IPv4 0x87dca03b91799403      0t0  TCP 
*:2181 (LISTEN)
   java    99692 zac.bentley  376u  IPv4 0x87dca03b91797fb3      0t0  TCP 
*:3181 (LISTEN)
   java    99692 zac.bentley  504u  IPv4 0x87dca03b76dab58b      0t0  TCP 
*:4181 (LISTEN)
   java    99692 zac.bentley  666u  IPv4 0x87dca03b82ccc403      0t0  TCP 
*:6650 (LISTEN)
   java    99692 zac.bentley  667u  IPv4 0x87dca03b770f527b      0t0  TCP 
*:8080 (LISTEN)
   ```
   
   In Wireshark, I'm able to see the good/working/stable client falling back 
from IPv6 to IPv4, thus:
   <img width="1792" alt="fail" 
src="https://user-images.githubusercontent.com/10999109/132364564-5f6b3156-7574-4ff4-86ad-12574ac88a95.png";>
   
   However, on `master` no fallback attempt to connect via IPv4 is made:
   <img width="1792" alt="fail" 
src="https://user-images.githubusercontent.com/10999109/132364704-d436b76b-9385-4145-90e3-2f9bc5bdaa25.png";>
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to