Search code examples
datastaxscylla

Datastax cassandra cpp_driver hangs when connecting to node


I setup a ScyllDB on my Debian 9.6 machine. When I run cqlsh I can connect to it and create tables, do queries etc.. Now I tried to write a simple program in C++ using the Datstax driver and it can't connect. It always blocks when it tries to connect.

The scylla package I installed is:

scylla | 3.0.11-0.20191126.3c91bad0d-1~stretch

cpp_driver is the current master from github: https://github.com/datastax/cpp-driver

Now I tried to run the examples/simple project which is included in the driver, so I assume that it should work, but it shows the same problem. I don't get any errors it just blocks

CassCluster* cluster = cass_cluster_new();
CassSession* session = cass_session_new();
char* hosts = "127.0.0.1";
cass_cluster_set_contact_points(cluster, hosts);
cass_cluster_set_protocol_version(cluster, CASS_PROTOCOL_VERSION_V4);
connect_future = cass_session_connect(session, cluster);

// here it blocks now forever...
er = cass_future_error_code(connect_future);

I also tried to run it on an Ubuntu 16.04 but it shows the same problem. Since the connect works, using the cqlsh I think it shouldn't be a configuration problem, but rather something with the cpp_driver.

I also traced the TCP connection, and I can see that the cpp_driver talks to the server, which looks similar to cqlsh conversation.


Solution

  • I finally found the solution for this issue. We were using cpp_driver 2.15.1 which apparently got some change in the even handling according to their release notes. When I downgraded to 2.15.0 the problem was gone and connection could be successfully established.