This patch is needed to fix a race condition as the commit message describes.
The callback is called before returning the descriptor back to free pool.
If the client calls free resources, the descriptor that was not returned to free pool gets lost due
to race condition.
Hmmm, if you have txn's pending and client wants to free up, shouldn't
the pending txn's be cleaned up? Sound like a different bug to me..
So if I submit 5 txn's and now want to freeup, will you still leak
descriptors? Doesn't sound as right behaviour to me.
I'll refactor the code after Dave's change for passing the error code while calling the
callback. That will be a different patch anyhow.
Yes the error reporting is different