Can't connect to ZooKeeper server with the C client library from Solaris: 
connect() call fails.
-----------------------------------------------------------------------------------------------

                 Key: ZOOKEEPER-1123
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1123
             Project: ZooKeeper
          Issue Type: Bug
          Components: c client
    Affects Versions: 3.3.3
         Environment: Client: Solaris 5.10, x86 machine.
Server: Linux Fedora 14
            Reporter: Tadeusz Andrzej Kadłubowski


I have a C app that runs on Solaris and connects to ZooKeeper which I run on 
Linux (just a single server instance, that's just a development setup).

Upon calling zookeeper_init() I get logs that say connect() call fails. 
TCP-wise the client sends RST packet instead of the third part of the three-way 
handshake. Traced client syscalls below.

Sometimes the client is able to establish a connection - after half an hour of 
trying, or even longer. 

Logs
====

The client logs:

2011-07-11 16:20:22,954:13148(0xf):ZOO_ERROR@handle_socket_error_msg@1501: 
Socket [10.10.1.71:2181] zk retcode=-4, errno=0(Error 0): connect() call failed

The server logs:

2011-07-11 16:20:22,950 - INFO  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn$Factory@251] - 
Accepted socket connection from /10.10.9.27:34017                               
                            
2011-07-11 16:20:22,955 - WARN  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@634] - 
EndOfStreamException: Unable to read additional data from client sessionid 0x0, 
likely client has closed socket     
2011-07-11 16:20:22,955 - INFO  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1435] - Closed socket 
connection for client /10.10.9.27:34017 (no session established for client)     
      

Syscalls in the client:

/15:    3516.6191       so_socket(PF_INET, SOCK_STREAM, IPPROTO_IP, "", 
SOV_DEFAULT) = 11                 
/15:    3516.6192       setsockopt(11, tcp, TCP_NODELAY, 0xFD8A8ECC, 4, 
SOV_DEFAULT) = 0                  
/15:    3516.6193       fcntl(11, F_GETFL)                              = 2     
                          
/15:    3516.6194       fcntl(11, F_SETFL, FWRITE|FNONBLOCK)            = 0     
                          
/15:    3516.6194       connect(11, 0x0813BA30, 16, SOV_DEFAULT)        Err#150 
EINPROGRESS               
/15:    3516.6195       write(2, " 2 0 1 1 - 0 7 - 1 2   1".., 23)      = 23    
                          
 <<< SNIP writing log message >>>                             
/15:    3516.6204       write(2, "\n", 1)                               = 1     
                          
/15:    3516.6205       close(11)                                       = 0 


What does work:
===============

Using Java client on the same Solaris machine works without any problems. 
Connecting to the Linux server using C client library on Linux works OK (though 
I tested it within one box, via loopback interface).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to