BIND 10 #2137: update the boss module according to the new statistics model
BIND 10 Development
do-not-reply at isc.org
Mon Aug 13 13:38:10 UTC 2012
#2137: update the boss module according to the new statistics model
-------------------------------------+-------------------------------------
Reporter: | Owner: naokikambe
naokikambe | Status: reviewing
Type: | Milestone:
enhancement | Sprint-20120821
Priority: | Resolution:
medium | Sensitive: 0
Component: | Sub-Project: DNS
statistics | Estimated Difficulty: 4
Keywords: | Total Hours: 0
Defect Severity: N/A |
Feature Depending on Ticket: |
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
Changes (by jelte):
* owner: jelte => naokikambe
Comment:
> Replying to [comment:7 jelte]:
> > The changes in get_stats_data() in boss make the stats daemon quit
during startup. That obviously needs to be fixed :)
> Sorry, I couldn't understand that. Do you mean the new _get_stats_data()
method can stop the stats daemon starting? Could you explain how should I
fix? In the former code, boss might have accidentally stopped because of
the wrong format.
>
The problem is that the new _get_stats_data() makes a response message of
the form
{ "boot_time": <some time> }
And the stats daemon expects the format
{ "owner": <owner>,
"data": <data>
}
So currently, upon startup of bind10, the stats daemon immediately
crashes:
{{{
2012-08-13 15:37:04.438 INFO [b10-stats.stats] STATS_STARTING starting
Traceback (most recent call last):
File "/home/jelte/repos/bind10/src/bin/stats/b10-stats", line 503, in
<module>
stats.start()
File "/home/jelte/repos/bind10/src/bin/stats/b10-stats", line 166, in
start
args["owner"], **args["data"])
KeyError: 'owner'
2012-08-13 15:37:04.446 INFO [b10-boss.boss] BIND10_PROCESS_ENDED process
18047 of b10-stats ended with status 256
}}}
> > But also, it is probably a good idea not catch formatting errors in
the stats daemon, and log an error if that happens (but to keep running)
> Do you mean boss should check the format of statistics data being sent
out? I don't think the validation is always needed because the format is
constant in boss. And should it log if it is invalid? The stats module
logs an error when it receives the wrong format from boss.
Oh, I don't think the boss should necessarily check its output, but I'd
check in stats.py.in whether the 'args' value does indeed contain "owner"
and "data" before continuing (and log an error otherwise);
e.g. something like either
{{{
if "owner" in args and "data" in args:
<process>
else:
logger.error(blabla)
}}}
or
{{{
if "owner" not in args or "data" not in args:
raise StatsError("Badly formatted response to get_stats, owner or
data missing")
}}}
but in the latter case, I'd make a raised statserror not fatal (but catch
it, log it as an error, and continue to run)
--
Ticket URL: <https://bind10.isc.org/ticket/2137#comment:9>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list