I am executing 2 threads . Both share same data socket.
I am trying to acquire session on both of them at same time but I use the flags as CDB_LOCK_REQUEST and CDB_LOCK_WAIT.
What I expect is one of the thread waits for session to be available. However I am getting error stating NEW_SESSION should be called after END_SESSION.
Is there anything wrong in understanding.
Following is given in Confd User Guide:
int cdb_start_session2(int sock, enum cdb_db_type db, int flags); API explanation
“In all cases of using CDB_LOCK_SESSION or CDB_LOCK_REQUEST described above, adding the
CDB_LOCK_WAIT flag means that instead of failing with CONFD_ERR_LOCKED if the lock can
not be obtained immediately, requests will wait for the lock to become available. When used with
CDB_LOCK_SESSION it pertains to cdb_start_session2() itself, with CDB_LOCK_REQUEST
it pertains to the individual requests.”