Confd end user session timeout

I am facing an intermittent issue. It happens once in 100 runs. Following is the code:
maapi.start_user_session(maapi_socket, user, context, groups, “”, _confd.PROTO_TCP)
tid = maapi.start_trans(maapi_socket, _confd.RUNNING, _confd.READ_WRITE)

maapi.create(maapi_socket, tid, base_path)
maapi.apply_trans(maapi_socket, tid, False)
maapi.finish_trans(maapi_socket, tid)
sleep(0.2) // Adding sleep here to give enough time to confd for processing.

It blocks at the last line of the code and comes out after timeout. I tried increasing timeout to 5 mins. Still it does not end user session. Is there any way to find why confd gets blocked? Please advise.

No sleep should be necessary. Are you using the same socket with other threads or processes? One socket per thread/process is the golden rule.

Example issue as a reference:

1 Like