How to Use Client Recovery API?

Hi,

I have come across a problem in using resource reclaim mechanism provided by HAM.

Requirement:
I need to reclaim a file descriptor which is become invalid while the program is being run. A program is written using
HAM client library functions.

Problem:
The problem is that, the handler function is not get invoked when the file descriptor become invalid (EBADF). The file which is being accessed is located on a remote machine and is accessed using samba. To test if the handler function is invoked upon descriptor become invalid, I did kill the samba client process (to make the descriptor invalid). As expected, the system call (read/write) would returns EBADF but the handler function is not get invoked!

Also I tried with a Null resource manager. i.e, A program is written using HAM client library function which continuously execute read and write calls to the file descriptor returned by ha_open( /dev/Null ,…). To test if the handler function is invoked upon descriptor become invalid, I did kill the Null resource manager (to make the descriptor invalid). As expected, the system call (read/write) would returns EBADF but the handler function is not get invoked! why is it so? :frowning:

NOTE:
Although the resource reclaim doesn’t work with file descriptors, I was able to reclaim a connection ID using HAM
client library (ha_ConnectAttach () & ha_ReConnectAttach ()).

I would also like to know how to recover the stale descriptors of message queues and shared memory when server restarts. Could you please provide some sample codes for the same or the common template followed?Please help.

Thanks,
Princi