Commit 7072a63a authored by unknown's avatar unknown

ndb - bug#20683

  part 1 - make sure return code is propagated from request tracker


ndb/src/kernel/vm/RequestTracker.hpp:
  propagate return value
ndb/src/kernel/vm/SafeCounter.hpp:
  make sure object is not initialized in case of seize() failure, to make sure destructor doesnt assert
parent 505c2b3d
...@@ -26,12 +26,12 @@ public: ...@@ -26,12 +26,12 @@ public:
void init() { m_confs.clear(); m_nRefs = 0; } void init() { m_confs.clear(); m_nRefs = 0; }
template<typename SignalClass> template<typename SignalClass>
void init(SafeCounterManager& mgr, bool init(SafeCounterManager& mgr,
NodeReceiverGroup rg, Uint16 GSN, Uint32 senderData) NodeReceiverGroup rg, Uint16 GSN, Uint32 senderData)
{ {
init(); init();
SafeCounter tmp(mgr, m_sc); SafeCounter tmp(mgr, m_sc);
tmp.init<SignalClass>(rg, GSN, senderData); return tmp.init<SignalClass>(rg, GSN, senderData);
} }
bool ignoreRef(SafeCounterManager& mgr, Uint32 nodeId) bool ignoreRef(SafeCounterManager& mgr, Uint32 nodeId)
......
...@@ -230,10 +230,13 @@ inline ...@@ -230,10 +230,13 @@ inline
bool bool
SafeCounter::init(NodeReceiverGroup rg, Uint16 GSN, Uint32 senderData){ SafeCounter::init(NodeReceiverGroup rg, Uint16 GSN, Uint32 senderData){
bool b = init<Ref>(rg.m_block, GSN, senderData); if (init<Ref>(rg.m_block, GSN, senderData))
{
m_nodes = rg.m_nodes; m_nodes = rg.m_nodes;
m_count = m_nodes.count(); m_count = m_nodes.count();
return b; return true;
}
return false;
} }
template<typename Ref> template<typename Ref>
...@@ -241,10 +244,13 @@ inline ...@@ -241,10 +244,13 @@ inline
bool bool
SafeCounter::init(NodeReceiverGroup rg, Uint32 senderData){ SafeCounter::init(NodeReceiverGroup rg, Uint32 senderData){
bool b = init<Ref>(rg.m_block, Ref::GSN, senderData); if (init<Ref>(rg.m_block, Ref::GSN, senderData))
{
m_nodes = rg.m_nodes; m_nodes = rg.m_nodes;
m_count = m_nodes.count(); m_count = m_nodes.count();
return b; return true;
}
return false;
} }
inline inline
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment