提交 30597936 编写于 作者: 丁劲犇's avatar 丁劲犇 😸

Add ref count check in pipe line , avoiding runtime-crash in 7*24 hours stability test

上级 50ccfdc4
#include "zp_clusternode.h"
#include "zp_clusterterm.h"
#include <assert.h>
namespace ZP_Cluster{
zp_ClusterNode::zp_ClusterNode(zp_ClusterTerm * pTerm, QObject * psock,QObject *parent) :
ZPTaskEngine::zp_plTaskBase(parent)
......@@ -56,6 +57,8 @@ namespace ZP_Cluster{
//qDebug()<<QString("%1(%2) Node Martked Deleted, return.\n").arg((unsigned int)this).arg(ref());
return 0;
}
if (ref()>1)
return -1;
int nCurrSz = -1;
int nMessage = m_nMessageBlockSize;
while (--nMessage>=0 && nCurrSz!=0 )
......@@ -71,7 +74,10 @@ namespace ZP_Cluster{
if (m_currentReadOffset >= block.size())
{
m_mutex_rawData.lock();
m_list_RawData.pop_front();
if (m_list_RawData.empty()==false)
m_list_RawData.pop_front();
else
assert(false);
m_currentReadOffset = 0;
m_mutex_rawData.unlock();
}
......
#include "st_clientnode_basetrans.h"
#include "st_client_table.h"
#include <assert.h>
namespace ExampleServer{
st_clientNode_baseTrans::st_clientNode_baseTrans(st_client_table * pClientTable, QObject * pClientSock ,QObject *parent) :
zp_plTaskBase(parent)
......@@ -48,6 +49,8 @@ namespace ExampleServer{
//qDebug()<<QString("%1(%2) Node Martked Deleted, return.\n").arg((unsigned int)this).arg(ref());
return 0;
}
if (ref()>1)
return -1;
int nCurrSz = -1;
int nMessage = m_nMessageBlockSize;
while (--nMessage>=0 && nCurrSz!=0 )
......@@ -63,7 +66,10 @@ namespace ExampleServer{
if (m_currentReadOffset >= block.size())
{
m_mutex_rawData.lock();
m_list_RawData.pop_front();
if (m_list_RawData.empty()==false)
m_list_RawData.pop_front();
else
assert(false);
m_currentReadOffset = 0;
m_mutex_rawData.unlock();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册