Cdb_sync_subscription_socket return Unexpected data on socket

I use two-phase commit, but when I first call cdb_sync_subscription_socket , it failed with “INTERNAL ERROR:Unexpected data on socket”.It did not happened every time and about 1/10.What does this error means or can I open more trace for troubleshooting?

The reason is likely that the application is mixing up its CDB and/or MAAPI sockets - e.g. two threads trying to use the same socket at the same time.

What it means is that a CDB or MAAPI API function makes a request to ConfD, and gets a response back from ConfD that doesn’t match the request.

The examples.confd/intro/9-c_threads/ example shows how one should handle these sockets when using multiple threads.

1 Like

thanks very much, it works after I add an lock for that two threads