ConfD User Community

TRACE CDB_NEW_SESSION stuck forever


#1

Hi Team,

I am using the cdb_start_session2(), to connect to new session on CDB_RUNNING.

After checking the TRACE logs for confD on application … could see start session stuck forever…

[17-7-2019 15:22:43] CONFD:Reading context Info
TRACE Connected (cdb) to ConfD
TRACE CDB_NEW_SESSION         ( Never got succeeded ) 
bash-4.3#

In cdb_start_session2() , using the flag CDB_LOCK_SESSION| CDB_LOCK_WAIT

Code snippet:

    if ((rsock = socket(PF_INET, SOCK_STREAM, 0)) < 0 )
      return CONFD_ERR;
    if (cdb_connect(rsock, CDB_READ_SOCKET, (struct sockaddr*)&eb_addr,
                sizeof (struct sockaddr_in)) < 0)
      return CONFD_ERR;
    if (cdb_start_session2(rsock, CDB_RUNNING, CDB_LOCK_SESSION| CDB_LOCK_WAIT) != CONFD_OK)
      return CONFD_ERR;
    if ((n = cdb_num_instances(rsock, "/ctxsipos:contexts/ctxipos:context"))
         < 0) {
        cdb_end_session(rsock);
        cdb_close(rsock);
        return n;
    }

Can you please help me what could be wrong here ?.

Regards,
Bibin


#2

Can you please help me in this ?.


#3

Since your flags argument to cdb_start_session2() requests that the call should wait until the lock has been acquired, the most likely explanation is that the call is doing exactly what you told it to do. I.e. for starters, check confd --status for locks on CDB.