BIND 10 #2676: Provide ccsession::rpc_call and replace usual calls with it
BIND 10 Development
do-not-reply at isc.org
Thu Feb 21 09:23:19 UTC 2013
#2676: Provide ccsession::rpc_call and replace usual calls with it
-------------------------------------+-------------------------------------
Reporter: vorner | Owner:
Type: enhancement | vorner
Priority: medium | Status:
Component: Inter-module | closed
communication | Milestone:
Keywords: | Sprint-20130305
Sensitive: 0 | Resolution:
Sub-Project: Core | complete
Estimated Difficulty: 2.5 | CVSS Scoring:
Total Hours: 16.62 | Defect Severity: N/A
| Feature Depending on Ticket:
| Add Hours to Ticket: 0
| Internal?: 0
-------------------------------------+-------------------------------------
Comment (by jinmei):
Replying to [comment:16 vorner]:
> For the record, I believe the variable was not set in the previous
version either. That's why I added the TODO about ignoring errors.
How can you believe that?
The very original code:
{{{#!python
def do_polling(self):
seq = self.cc_session.group_sendmsg(
isc.config.ccsession.create_command("show_processes"),
'Init')
(answer, env) = self.cc_session.group_recvmsg(False, seq)
modules = []
if answer:
(rcode, value) = isc.config.ccsession.parse_answer(answer)
if rcode == 0 and type(value) is list:
modules = [ v[2] if type(v) is list and len(v) > 2 \
else None for v in value ]
# start requesting each module to collect statistics data
sequences = []
}}}
So regardless of the return value of group_recvmsg(), modules is set
to a null list.
By de4ecfcd4827e8e0002c426e11e5ad36e7e14da3 you changed that with the
TODO comment:
{{{#!python
def do_polling(self):
try:
value = self.mccs.rpc_call('show_processes', 'Init')
if type(value) is list:
modules = [ v[2] if type(v) is list and len(v) > 2 \
else None for v in value ]
except isc.config.RPCError:
# TODO: Is it OK to just pass? As part of refactoring,
preserving
# the original behaviour.
pass
sequences = []
}}}
So, if group_recvmsg() returns non 0 answer, rpc_call() raises
`RPCError`, skipping the initialization of `modules`. Please at least
refer to the very original code before making such assertion.
This also indicated it's really bad we didn't have sufficient tests;
if we had, we wouldn't have to discuss these things.
--
Ticket URL: <http://bind10.isc.org/ticket/2676#comment:17>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list