Cannot set socket timeout lower than 1000 msec in Hot Rod C++ client

Solution In Progress - Updated -

Environment

  • Red Hat JBoss Data Grid (JDG)
    • All 6.x prior to 6.6

Issue

  • ConfigurationBuilder.socketTimeout(999) gives you an error like follows.
TRACE [Socket.cpp:107] Trying to connect to 127.0.0.1 (127.0.0.1).
DEBUG [ConnectionPool.cpp:133] Ensuring idle connection limits
DEBUG [ConnectionPool.cpp:138] Testing idle connections
DEBUG [Socket.cpp:134] Attempting connection to 127.0.0.1:11222
DEBUG [Socket.cpp:184] Connected to 127.0.0.1:11222
TRACE [PingOperation.cpp:27] Executing Ping
TRACE [TcpTransportFactory.cpp:130] Initial ping has thrown an exception when pinging 127.0.0.1:11222 : timeout (host: 127.0.0.1 port: 11222) Resource temporarily unavailable

Resolution

  • Upgrade to JDG 6.6.0 or later.

Root Cause

BZ-1273314: Cannot set socketTimeout lower than 1000 in C++ client

Diagnostic Steps

You can generate a debug log of the C++ client by environment variable "HOTROD_LOG_LEVEL". The output is stderr and "TRACE", "DEBUG", "INFO", "WARN", and "ERROR" levels are available. Here is an example.

$ HOTROD_LOG_LEVEL="TRACE" ./your_program

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments