BIND 10 #2833: refactor relationship between datasrc::ClientList and ZoneTableSegment
BIND 10 Development
do-not-reply at isc.org
Wed Apr 3 07:27:49 UTC 2013
#2833: refactor relationship between datasrc::ClientList and ZoneTableSegment
-------------------------------------+-------------------------------------
Reporter: jinmei | Owner:
Type: task | jinmei
Priority: medium | Status:
Component: Unclassified | reviewing
Keywords: | Milestone:
Sensitive: 0 | Sprint-20130423
Sub-Project: DNS | Resolution:
Estimated Difficulty: 5 | CVSS Scoring:
Total Hours: 3.87 | Defect Severity: N/A
| Feature Depending on Ticket:
| shared memory data source
| Add Hours to Ticket: 0
| Internal?: 0
-------------------------------------+-------------------------------------
Changes (by vorner):
* owner: vorner => jinmei
* totalhours: 0 => 3.87
Comment:
Hello
Replying to [comment:16 jinmei]:
> > I believe calling a wrong type of value a syntax error might be
slightly confusing. Usually, when someone talks about syntax errors, I
imagine something like missing parentheses or such. Wrong type of value
looks more like semantic error.
> >
> > {{{#!c++
> > /// For other data source types than "MasterFiles", cache can be
disabled.
> > /// In this case cache-zones configuration item is simply ignored,
even
> > /// it contains a syntax or semantics error.
> > }}}
>
> Hmm, calling it a semantics error doesn't sound quite right to me
> either, and at this point errors like a missing parenthesis shouldn't
> happen, which is one of few things that the weakly-typed
> `data::Element` class can ensure. But in any case, I tried to updated
> the doc without using the controversial word of "syntax".
That's why I found it so confusing ‒ I asked myself how could a syntax
error get there if the JSON was already parsed.
Anyway, it's better now.
> > The zero here should be `NULL`:
> > {{{#!c++
> > prepareSource(Name::ROOT_NAME(), 0);
> > }}}
>
> Actually, since the discussion on whether to allow direct evaluation
> of pointers as boolean, I've been inclined to use 0 rather than the
> macro of `NULL`. "The C++ Programming Language" also suggests:
> "Because of C++'s tighter type checking, the use of plain 0, rather
> than any suggested NULL macro, leads to fewer problems". We actually
> saw an issue with `NULL` when we found we cannot use it to represent
> the NULL RR type. In reality, it's less likely that we can completely
> be free from this type of troubles even if we stop using `NULL`
> internally, but I think it will still help reduce troubles.
I'd be opposed to such switch. Not for some technical reason, but
generally, you need to expect the existence of the NULL macro anyway,
since any header might include something that contains it (if not on one
system, others could have it).
And I find it very useful to distinguish zero the number, zero the end of
string ('\0') and zero the invalid pointer (NULL). Not because the
compiler couldn't deduce it from the context. But because it helps the
reader. If I see 0 as a number somewhere, I understand it that the
function can be told how much of something should there be and we want
none, not that some object does not exist.
> > In these files, the static data source was used because there was in-
memory data source first and once it stopped being available directly,
this was the easiest way to switch. Maybe we should switch back now and
use master-files with some real zone and cache?
>
> Please see my previous "quick question" and clarify what this is
> about.
Ah, I forgot to paste the file names. Yes, the python tests:
* `src/lib/python/isc/datasrc/tests/datasrc_test.py`
* `src/lib/python/isc/datasrc/tests/zone_loader_test.py`
The new code contains this strange sentence:
{{{
it contains an error that would other trigger an exception.
}}}
What is meant by other? Should it be otherwise?
I think these are minor enough, I don't need to see it again. So, please
merge.
--
Ticket URL: <http://bind10.isc.org/ticket/2833#comment:17>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list