Skip to content

Commit

Permalink
Merge "Fix for assert in IFMapExporter::StateUpdateOnDequeue" into R2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed May 1, 2015
2 parents f16323d + 472be59 commit 5ed94b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ifmap/ifmap_exporter.cc
Expand Up @@ -544,7 +544,7 @@ void IFMapExporter::StateUpdateOnDequeue(IFMapUpdate *update,
}
if (update->advertise().empty()) {
state->Remove(update);
if (state->update_list().empty() && state->IsInvalid()) {
if (state->CanDelete()) {
assert(state->advertised().empty());
db_entry->ClearState(table, TableListenerId(table));
delete state;
Expand Down
7 changes: 7 additions & 0 deletions src/ifmap/ifmap_update.h
Expand Up @@ -134,6 +134,7 @@ class IFMapState : public DBState {
virtual bool IsInvalid() const { return sig_ == kInvalidSig; }
const crc32type &crc() const { return crc_; }
void SetCrc(crc32type &crc) { crc_ = crc; }
virtual bool CanDelete() = 0;

protected:
static const uint32_t kInvalidSig = -1;
Expand Down Expand Up @@ -171,6 +172,9 @@ class IFMapNodeState : public IFMapState {
const BitSet &nmask() const { return nmask_; }
void nmask_clear() { nmask_.clear(); }
void nmask_set(int bit) { nmask_.set(bit); }
virtual bool CanDelete() {
return (update_list().empty() && IsInvalid() && !HasDependents());
}

private:
DEPENDENCY_LIST(IFMapLink, IFMapNodeState, dependents_);
Expand All @@ -189,6 +193,9 @@ class IFMapLinkState : public IFMapState {

IFMapNodeState *left() { return left_.get(); }
IFMapNodeState *right() { return right_.get(); }
virtual bool CanDelete() {
return (update_list().empty() && IsInvalid());
}

private:
DependencyRef<IFMapLink, IFMapNodeState> left_;
Expand Down

0 comments on commit 5ed94b0

Please sign in to comment.