[AGENT++] AgentX++ suagent commiterror let the RowStatus in detroy(6); the row is block forever!
Claus Klein
claus.klein at arcormail.de
Sun Oct 31 12:02:11 CET 2010
Hi Frank,
my first interpretation of my test was not right. The handling with
commit failed works fine!
But still there may be a problem if the AgentXSlave 'deallocate
request' fails.
Too, It is not very efficiently if we register a row only to destroy
it immediately?
I changed a little bit at the code and improved the RowStatus destroy
handling.
I hope it is right, I am not sure! Please check it.
Too I improved my test scripts, I attache my patch and the scripts.
With regards,
Claus
claus-kleins-macbook-pro:AgentPro clausklein$ bzr diff -p1
=== modified file 'agent++/src/mib.cpp'
--- old/agent++/src/mib.cpp 2010-10-31 08:30:19 +0000
+++ new/agent++/src/mib.cpp 2010-10-31 10:28:54 +0000
@@ -572,10 +572,10 @@
return ((l == rowNotInService) ||
(l == rowActive) || (l == rowDestroy));
default:
- return FALSE;
+ return (l == rowDestroy); // FIXME: added! We have to allow
destroy in each state! ck
}
}
- else
+ else // FIXME: what state is this? ck
return ((l == rowCreateAndGo) || (l == rowCreateAndWait) ||
(l == rowDestroy));
}
@@ -672,7 +672,7 @@
break;
case rowDestroy:
set_value(rs);
- delete undo; // No undo of row destroy!
+ delete undo; // FIXME: why, ck? No undo of row destroy!
undo = 0;
break;
default:
@@ -2177,10 +2177,12 @@
ok = TRUE;
wait = TRUE;
break;
+#if 1 // FIXME: Do we allow destroy of a nonexiting row without
error? YES! ck
case rowDestroy:
ok = TRUE;
ignore = TRUE;
break;
+#endif
default:
delete[] fulfilled;
delete[] required;
@@ -2236,6 +2238,7 @@
pvbs[col] = req->get_value(i);
}
}
+
// test values through prepare
MibTableRow* new_row = new MibTableRow(generator);
new_row->set_index(new_index);
@@ -2304,14 +2307,15 @@
else
voting_result = perform_voting(new_row,
rowEmpty, rowDestroy);
- delete new_row;
-
// Unset the ready flag of the current column.
// via this one all the other columns are set by commit_set_request
req->unset_ready(ind);
delete[] fulfilled;
delete[] required;
delete[] pvbs;
+ delete new_row; // FIXME: same oder as other cleanup blocks; ck
+ // TODO: use a macro for cleanup or better spart pointers? ck
+
return voting_result;
}
claus-kleins-macbook-pro:AgentPro clausklein$
-------------- next part --------------
On 29.10.2010, at 22:59, Claus Klein wrote:
> Hi Frank,
>
> I have found a third issue about the RowStatus handling at the
> subagent.
> With this script, you can force this error as many times you want,
> simple choose a new row index.
>
> Kindly regards,
> Claus
>
More information about the AGENTPP
mailing list