On 27/02/15 08:44, Frank Ch. Eigler wrote:
... wherein a missing pcp.conf file was deemed a "FATAL PCP
ERROR" and resulted in a process exit(). This sort of error handling
is not appropriate within a library, as the application is better
equipped to judge the severity of the problem.
Ahem, I beg to differ here.
If pcp.conf is missing then pretty much NOTHING works in pcpland ...
this really is a fatal error.
Now while I agree that libraries as a rule should not call exit() there
are cases where it makes no sense to continue ... this is one of them in
my humble view.
And if the semantics of pmGetConfig() is to be changed, then we'd need
to go find all the uses of pmGetConfig() and validate that they are
indeed making an appropriate judgement ... a quick scan shows
179 uses of pmGetConfig
none in the context of an if ()
only 37 of these are of the form ... = pmGetConfig()
So I'd be willing to guess that there are 150+ cases where the code has
been written with the assumption that if pcp.conf is not available there
is no point continuing.
Note that pcp.conf not being available is at a whole different level of
severity to SOMEVAR not be defined in pcp.conf.
|