A C++ Hot Rod client, which is executing about 560 get/sec and 50 put/sec concurrently, occasionally receives an exception with the following error message. Invalid message id. Expected 5774 and received 4436 It seems the message id counter is not thread-safe.
Here are snippets from the current master. https://github.com/infinispan/cpp-client/blob/master/src/hotrod/impl/protocol/Codec10.cpp Gloal variable: 25 // TODO : multithread management 26 long Codec10::msgId = 0; In writeHeader: 38 // TODO : multithread management 39 transport.writeVLong(params.setMessageId(++msgId).messageId); In readHeader: 82 if (receivedOpCode != params.opRespCode) { 83 if (receivedOpCode == HotRodConstants::ERROR_RESPONSE) { 84 checkForErrorsInResponseStatus(transport, params, status); 85 } 86 std::ostringstream message; 87 message << "Invalid response operation. Expected " << std::hex << 88 (int) params.opRespCode << " and received " << std::hex << (int) receivedOpCode; 89 throw InvalidResponseException(message.str()); 90 }
Created attachment 1057224 [details] hotrodwrapper.zip Minimum reproducing set of files for Nginx (OpenResty). Find README.en in the archive.
Verified with JDG 6.5.1 CR1 I ran the siege test 10,000 times without seeing the error, so I am closing this BZ for now until there is a reproducer for this.