HPNL
HPNL copied to clipboard
Content sent via sendBuf/sendBufTo is not correct
Take sendBuf as example, the parameter buffer is not put to fi_context2. After sendBuf method return, the pointer may be get released even the buffer pointer was passed to fi_send which is asynchronous. Thus, the content referenced by the buffer pointer may be not the same content when we call sendBuf. It causes incorrect content being sent.
int RdmConnection::sendBuf(const char* buffer, int buffer_size)
@tanghaodong25 , please check.
yes, I'm thinking if we can use fi_sendmsg with FI_INJECT_COMLETION, which guarantees that the buffers will not be read from again and the application may reclaim them. Do you have any suggestion?
@tanghaodong25 , I fixed the issue by referencing it from the chunk which is in-turn referenced by fi_context2. It makes sure buffer not being released after sendBuffer return. Before that, I removed the "const" modifier of buffer. otherwise, I cannot set it to chunk's buffer. see RdmConnection.cc in the branch eventpool_rdm_queue.